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