How to log query parameters instead of variables with log_min_duration_statement

Поиск
Список
Период
Сортировка
От Max Williams
Тема How to log query parameters instead of variables with log_min_duration_statement
Дата
Msg-id 0357196CB603794BB76F4F6B373F27330506EACE98@SERVER.ddnglobal.local
обсуждение исходный текст
Ответы Re: How to log query parameters instead of variables with log_min_duration_statement  (zhong ming wu <mr.z.m.wu@gmail.com>)
Re: How to log query parameters instead of variables with log_min_duration_statement  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general

Hi,

I am logging long queries with log_min_duration_statement but would like to see the parameters for parameterized queries. Eg…

 

Jun 28 10:21:49 dbs1 postgres[20866]: [2-1] LOG:  duration: 6625.543 ms  execute PRSTMT1405204512-1371060978/PORTAL1405204512-1371060978: SELECT COUNT(*)

Jun 28 10:21:49 dbs1 postgres[20866]: [2-2]        FROM "XYZ123" AS "T0"

Jun 28 10:21:49 dbs1 postgres[20866]: [2-3]        WHERE ("T0"."Id" = $1)

 

I’d like to log or find out what $1 was from the postgresql server side, not the application side. Is this possible?

Best Regards,

Max Williams

В списке pgsql-general по дате отправления:

Предыдущее
От: Konstantin Izmailov
Дата:
Сообщение: Re: PQprepare in PostgreSQL 7.4 (lack of SAVEPOINTs)
Следующее
От: zhong ming wu
Дата:
Сообщение: Re: How to log query parameters instead of variables with log_min_duration_statement