Skip site navigation (1) Skip section navigation (2)

DDL & DML Logging doesn't work for calling functions

From: MURAT KOÇ <m(dot)koc21(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: DDL & DML Logging doesn't work for calling functions
Date: 2011-11-29 20:40:12
Message-ID: CAA4y46wNbp57O-QfSzxSSqVTyzAJ5t3-gcNTxvCpGf+p-hE4Cw@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-general
 Hi list,

Version is PostgreSQL 9.0.4 on x86_64-unknown-linux-gnu, compiled by GCC
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-51), 64-bit.

We set logging parameters as below for DDL & DML Logging:
logging_collector = on
log_statement = mod
log_line_prefix = '%t--%d--%u--%h--%a--%i--%e'

Server log file consists as below sample log information:
2011-11-28 16:35:23 EET--postgres--postgres--136.10.195.51--pgAdmin III -
Query Tool--idle--00000LOG:  statement: update test set t=10 where t=3;
2011-11-28 16:35:34 EET--postgres--postgres--136.10.195.51--pgAdmin III -
Query Tool--idle--00000LOG:  statement: update test set t=10 where t=5;

Logging works successfully while we run direct DML commands like "insert,
update, delete".

But, when I call a function that does DML, logging doesn't work and server
log file has no information about calling function.

I call function like this: SELECT p_dummy_insert();

###This is sample insert function###
CREATE OR REPLACE FUNCTION p_dummy_insert ()
  RETURNS void AS
$BODY$
BEGIN
 INSERT INTO employee values ('dummy', 'test');
END$BODY$
  LANGUAGE plpgsql VOLATILE
  COST 100;

"Not logging of function calls" is expected behavior or a bug? We have no
information on server logs about who called function or when was it called
or what did called function do?

Regards,
Murat KOC

Responses

pgsql-general by date

Next:From: Tyler HainsDate: 2011-11-29 21:28:36
Subject: Re: Query Optimizer makes a poor choice
Previous:From: Scott MarloweDate: 2011-11-29 20:34:14
Subject: Re: Query Optimizer makes a poor choice

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group