Run as Root (FreeBSD 10.3)
portsnap fetch
portsnap extract
kldload dtraceall
chmod 0666 /dev/dtrace/helper
chmod 0666 /dev/dtrace/dtrace
echo “dtraceall_load=YES” >> /boot/loader.conf
echo “perm /dev/dtrace/helper 0666” >> /etc/devfs.conf
cd /usr/ports/database/postgresql9x
make config (select Dtrace)
make
make install clean
echo “postgresql_enable=’YES'” >> /etc/rc.conf
/usr/local/etc/rc.d/postgresql initdb
/usr/local/etc/rc.d/postgresql start
reboot
dtrace -n ‘postgresql*:::query-start{ printf(“%s”, copyinstr(arg0)); }’