Re: retrieve statement from catalogs

From: Shridhar Daithankar <shridhar_daithankar(at)persistent(dot)co(dot)in>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: retrieve statement from catalogs
Date: 2003-10-28 09:19:06
Message-ID: 200310281449.06268.shridhar_daithankar@persistent.co.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tuesday 28 October 2003 14:33, Jaime Casanova wrote:
> Hi everybody, can anyone tell me if there's a way to retrieve the select
> instruction executed from the catalogs, or maybe via some structure in a
> trigger?
>
> The reason is that i have some selects constructed on-the-fly (just part of
> it) and i want to save that in a table in order to know what are the most
> used for optimizing them.
>
> Another reason for doing that is that i don't know all the selects in the
> program nor the page and this is an easier solution than examine all the
> code.

Use pg_ctl -l logfile option to start postmaster. It will log the things. And
set log_statement=true in postgresql.conf.

So there will be all the sql statements logged in.

HTH

Shridhar

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tino Wildenhain 2003-10-28 09:41:42 Re: PostgreSQL with MS Query?
Previous Message Jaime Casanova 2003-10-28 09:03:12 retrieve statement from catalogs