Expose call stack through an SQL function in PostgreSQL