Re: Logging the query executed on the server

Поиск
Список
Период
Сортировка
От Steve Baldwin
Тема Re: Logging the query executed on the server
Дата
Msg-id CAKE1AiZAR_7qqi=HB9kSf7oq5zrANKt=OxcFYHCUHnDfZJ7ZUg@mail.gmail.com
обсуждение исходный текст
Ответ на Logging the query executed on the server  (Igor Korot <ikorot01@gmail.com>)
Ответы Re: Logging the query executed on the server  (Igor Korot <ikorot01@gmail.com>)
Список pgsql-general
Hi Igor,

Before you issue your query, try something like this:

(from psql, but hopefully you get the idea)

b2bcreditonline=# set log_min_duration_statement to 0;
SET
b2bcreditonline=# set log_statement to 'all';
SET


Then submit your query and it will be set to the server log. You can get the name of the current logfile with:

b2bcreditonline=# select pg_current_logfile();
 pg_current_logfile
--------------------
 /log/pg.csv

HTH,

Steve

On Sun, Jul 24, 2022 at 3:26 PM Igor Korot <ikorot01@gmail.com> wrote:
Hi,
Is it possible to log the query that will be executed
on the server?

I'm writing an application that connects to the server
through ODBC and libpq.
For some reason ODBC interface is failing - it desn't
return any rows

So I'm thinking if I have a proof that the query I am
actually executing is the same as the one I run through
the psql - I will know where to look.

I am actually binding some parameters and trying to
execute the query.

Thank you.


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

Предыдущее
От: Igor Korot
Дата:
Сообщение: Logging the query executed on the server
Следующее
От: Igor Korot
Дата:
Сообщение: Re: Logging the query executed on the server