Re: Logging Parameter Values

From: Volkan YAZICI <yazicivo(at)ttmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Logging Parameter Values
Date: 2008-06-19 14:54:32
Message-ID: 87wskleaqf.fsf@alamut.mobiliz.com.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 19 Jun 2008, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> What PG version are you using? Since 8.2 log_duration should show
> parameter values.

I don't want to interrupt your work, but as far as I see from logs --
with the configurations I sent previously -- PostgreSQL doesn't log
parameter values for queries dropped into query duration limit. (Using
PostgreSQL 8.3.1.) Consider this test case:

test# PREPARE foo (int) AS
] SELECT S.i * T.i
] FROM generate_series(1, $1) AS S(i),
] generate_series(1, $1) AS T(i);

test# EXECUTE foo (1000);
...

# tail -n 2 /srv/pg/pg_log/2008-06-19_141725.log
migration_test postgres 2008-06-19 17:58:05.185 EEST LOG: duration: 2315.420 ms statement: EXECUTE foo(1000);
migration_test postgres 2008-06-19 17:58:05.185 EEST DETAIL: prepare: PREPARE foo (int) AS SELECT S.i * T.i FROM generate_series(1, $1) AS S(i), generate_series(1, $1) AS T(i);

> As for the other, you'd have to turn on log_statements so that the
> parameters get logged in advance of the failure. Once the transaction
> has failed we can't call user-defined output functions, since they
> might try to do things that don't work inside a failed transaction.

I see.

Regards.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-06-19 15:05:25 Re: Logging Parameter Values
Previous Message Tom Lane 2008-06-19 14:50:10 Re: Vacuum and inserts