From: | Igor Korot <ikorot01(at)gmail(dot)com> |
---|---|
To: | Steve Baldwin <steve(dot)baldwin(at)gmail(dot)com> |
Cc: | "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Logging the query executed on the server |
Date: | 2022-07-24 06:29:01 |
Message-ID: | CA+FnnTwhLf4OyiQ4=AHssNjauVdAs7pZqqWd6QqWzB353mnDZA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi, Steve,
On Sun, Jul 24, 2022 at 12:51 AM Steve Baldwin <steve(dot)baldwin(at)gmail(dot)com> wrote:
>
> 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
>
> Ref: https://www.postgresql.org/docs/current/sql-set.html, https://www.postgresql.org/docs/current/config-setting.html
>
> 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
2 things:
1. How do I turn this off? ;-)
2. The log does show the query but it shows it with the placeholders.
Is there a way to see the actual query?
Thank you.
>
> HTH,
>
> Steve
>
> On Sun, Jul 24, 2022 at 3:26 PM Igor Korot <ikorot01(at)gmail(dot)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.
>>
>>
From | Date | Subject | |
---|---|---|---|
Next Message | Steve Baldwin | 2022-07-24 07:13:49 | Re: Logging the query executed on the server |
Previous Message | Steve Baldwin | 2022-07-24 05:51:00 | Re: Logging the query executed on the server |