Re: Logging of sql statements? - Mailing list pgsql-general

From Andreas Kretschmer
Subject Re: Logging of sql statements?
Date
Msg-id 20060323162138.GB7245@KanotixBox
Whole thread Raw
In response to Re: Logging of sql statements?  (Bjørn T Johansen <btj@havleik.no>)
Responses Re: Logging of sql statements?
List pgsql-general
Bjørn T Johansen <btj@havleik.no> schrieb:
> > Set in your postgresql.conf:
> >
> > log_statement = all
> >
> > Since 8.0 oder 8.1, there you can see parameters in prepared statements.
> >
> >
> >
> > HTH, Andreas
>
>
> This is what I am already using and it doesn't work...

It works for me ;-)

test=# prepare my_foo(int) as select * from foo where id = $1;
PREPARE
test=#
test=# execute my_foo(1);
 id | x
----+----
  1 | 10
(1 row)


In my log:
LOG:  statement: prepare my_foo(int) as select * from foo where id = $1;
LOG:  statement: execute my_foo(1);  [client PREPARE:  prepare my_foo(int) as select * from foo where id = $1;]


test=# select version();
                                                   version
--------------------------------------------------------------------------------------------------------------
 PostgreSQL 8.1.2 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.0.3 20060104 (prerelease) (Debian 4.0.2-6)
(1 row)



HTH, Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."    (unknow)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Logging of sql statements?
Next
From: Miroslav Šulc
Date:
Subject: Re: Updating database structure