pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: IJS/System - Joko <system@ijs.co.id>
To: pgsql-admin@postgresql.org
Subject: Re: logging SQL statements
Date: Sat, 11 Oct 2008 08:27:45 +0700
Message-ID: <48F00111.7070801@ijs.co.id> (raw)
In-Reply-To: <08312950-67ba-43ad-9d6d-2c2e1b227274@o40g2000prn.googlegroups.com>
References: <d8e7a1e30810090623i7766fc50xb46fc3e5efa3836@mail.gmail.com>
	<08312950-67ba-43ad-9d6d-2c2e1b227274@o40g2000prn.googlegroups.com>

It's surely possible.

Just enable this at postgresql.conf:
log_destination = 'stderr'
redirect_stderr = on

And then choose what to log:
log_statement = 'all'

Valid values are none, ddl, mod, and all. ddl logs all data definition 
commands like CREATE, ALTER, and DROP commands. mod logs all ddl 
statements, plus INSERT, UPDATE, DELETE, TRUNCATE, and COPY FROM. 
PREPARE and EXPLAIN ANALYZE statements are also logged if their 
contained command is of an appropriate type.

And u can modify other variables as you want.

Regards,
Joko [IT/EDP]
PT. Indra Jaya Swastika
Phone: +62 31 7481388  Ext 201
http://www.ijs.co.id



Jagadeesh wrote:
> On Oct 9, 6:23 pm, shreeseva.learn...@gmail.com ("c k") wrote:
>   
>> Is it possible to log all sql statements submitted to database server in a
>> table in that database it self? This will be different from database logs
>> which are written by db server.
>> Regards,
>> CPK
>>     
>
> I am not confident but it should be posible. some settings like debug
> would log every thing in a logfile.
> Will check more on this and update.
> Thanks
>
>   


--
If you have any problem with our services ,
please contact us at 70468146 or e-mail: helpdesk@ijs.co.id
PT Indra Jaya Swastika | Jl. Kalianak Barat 57A | +62-31-7481388

view thread (4+ messages)

Message-ID: <48F00111.7070801@ijs.co.id>
Permalink:  ../48F00111.7070801@ijs.co.id/
Also on:    postgresql.org/message-id/48F00111.7070801@ijs.co.id

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: system@ijs.co.id
  Subject: Re: logging SQL statements
  In-Reply-To: <48F00111.7070801@ijs.co.id>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox