Update audit.sql

avoid lookup into system catalog. use function instead.