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

From Bjørn T Johansen
Subject Re: Logging of sql statements?
Date
Msg-id 20060323215007.0836366c@pennywise.havleik.no
Whole thread Raw
In response to Re: Logging of sql statements?  (Andreas Kretschmer <akretschmer@spamfence.net>)
Responses Re: Logging of sql statements?  (Scott Marlowe <smarlowe@g2switchworks.com>)
List pgsql-general
On Thu, 23 Mar 2006 17:21:38 +0100
Andreas Kretschmer <akretschmer@spamfence.net> wrote:

> 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

If I try the same from a client, I get the same result.. But when running from my webapp (using Hibernate),
only question marks appear....?


BTJ

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: [DOCS] COPY command documentation
Next
From: Steve Crawford
Date:
Subject: Re: version problem with pg_dump