Re: log_statement and PREPARE

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: log_statement and PREPARE
Дата
Msg-id 8211.1189127867@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: log_statement and PREPARE  (brian <brian@zijn-digital.com>)
Ответы Re: log_statement and PREPARE  (brian <brian@zijn-digital.com>)
Список pgsql-general
brian <brian@zijn-digital.com> writes:
> But that should mean that my prepared statement that contains an INSERT
> should be logged, yes? (8.1 issues notwithstanding)
> I ask because i've set log_statement to 'mod' but am not seeing any
> of my prepared statements in the log. INSERT, UPDATE, and friends i
> do see.

Hm, works for me:

regression=# create temp table fooey(f1 int);
CREATE TABLE
regression=# prepare foo(int) as insert into fooey values($1);
PREPARE
regression=# execute foo(42);
INSERT 0 1
regression=# show log_statement;
 log_statement
---------------
 mod
(1 row)

in log:

LOG:  statement: create temp table fooey(f1 int);
LOG:  statement: prepare foo(int) as insert into fooey values($1);

The same sequence in 8.2 logs:

LOG:  statement: create temp table fooey(f1 int);
LOG:  statement: prepare foo(int) as insert into fooey values($1);
LOG:  statement: execute foo(42);
DETAIL:  prepare: prepare foo(int) as insert into fooey values($1);

If what you were looking for was that the *execute* gets logged
dependent on what the prepared statement was, then you need 8.2.
All that stuff got rewritten pretty heavily for 8.2 ...

            regards, tom lane

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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Call for Speakers PostgreSQL Conference Fall 2007
Следующее
От: Michael Glaesemann
Дата:
Сообщение: Re: Column as arrays.. more efficient than columns?