Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 15EEF37D299 for ; Fri, 10 Oct 2008 22:28:31 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 44927-02 for ; Fri, 10 Oct 2008 22:28:27 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from unicorn.sby.dnet.net.id (unicorn.sby.dnet.net.id [202.148.11.52]) by postgresql.org (Postfix) with ESMTP id 401EC37D294 for ; Fri, 10 Oct 2008 22:28:26 -0300 (ADT) Received: from unicorn.sby.dnet.net.id (localhost [127.0.0.1]) by unicorn.sby.dnet.net.id (Postfix) with ESMTP id 9881B23A02AE for ; Sat, 11 Oct 2008 08:28:21 +0700 (WIT) Received: from neptunus.sby.dnet.net.id (neptunus.sby.dnet.net.id [202.148.11.37]) by unicorn.sby.dnet.net.id (Postfix) with ESMTP id 8593023A01BC for ; Sat, 11 Oct 2008 08:28:21 +0700 (WIT) Received: from ijs.co.id (unknown [202.148.12.194]) by neptunus.sby.dnet.net.id (Postfix) with ESMTP id 4293B97EDE for ; Sat, 11 Oct 2008 08:28:17 +0700 (WIT) Received: from 192.140.6.18 ([192.140.6.18]) (authenticated user edp03@ijs.co.id) by ijs.co.id (ijs.co.id [192.140.6.10]) (MDaemon.PRO.v6.8.5.R) with ESMTP id 56-md50000000042.tmp for ; Sat, 11 Oct 2008 08:25:48 +0700 Message-ID: <48F00111.7070801@ijs.co.id> Date: Sat, 11 Oct 2008 08:27:45 +0700 From: IJS/System - Joko User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Re: logging SQL statements References: <08312950-67ba-43ad-9d6d-2c2e1b227274@o40g2000prn.googlegroups.com> In-Reply-To: <08312950-67ba-43ad-9d6d-2c2e1b227274@o40g2000prn.googlegroups.com> Content-Type: multipart/alternative; boundary="------------010702040800030802070601" X-Authenticated-Sender: edp03@ijs.co.id X-Spam-Processed: ijs.co.id, Sat, 11 Oct 2008 08:25:48 +0700 (not processed: message from trusted or authenticated source) X-MDRemoteIP: 192.140.6.18 X-Return-Path: system@ijs.co.id X-MDaemon-Deliver-To: pgsql-admin@postgresql.org X-Virus-Scanned: ClamAV using ClamSMTP X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.6 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001, RCVD_NUMERIC_HELO=2.599 X-Spam-Level: ** X-Archive-Number: 200810/93 X-Sequence-Number: 30549 This is a multi-part message in MIME format. --------------010702040800030802070601 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------010702040800030802070601 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 --------------010702040800030802070601--