我想查看我的存储过程正在执行的sql语句,但是我只能让调用查询显示在日志中。例如:
CREATE FUNCTION logtest(text) RETURNS text AS $$
SELECT 'you said: ' || $1;
$$ LANGUAGE SQL;
test=# set client_min_messages=LOG;
test=# set log_statement='all';
test=# select logtest('hello');
LOG: statement: select logtest('hello');
logtest
-----------------
you said: hello
(1 row)
但我想看到的是:
LOG: statement: SELECT 'you said: ' || $1;