Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 2EF699FA1FE for ; Fri, 1 Dec 2006 12:41:12 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 38585-03 for ; Fri, 1 Dec 2006 12:40:51 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.183]) by postgresql.org (Postfix) with ESMTP id 9197A9FA173 for ; Fri, 1 Dec 2006 12:40:51 -0400 (AST) Received: by py-out-1112.google.com with SMTP id d32so1846061pye for ; Fri, 01 Dec 2006 08:40:51 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=rGs72o5hcpVWmrd5EU560OmuJsBjz1p2a+3zDHeGP+CqjZ7MMajHowJ7CqfJsMV23oUgFbX8ZJ8MbetBNOx+u/Wfx4CZliwtfZoQdE1sQAy9IaSEyw0Ya0pjvH/MR2kF2rn0mV5NjnazkfWwWxvThme+/a52eiJXnSSe1Q0icb4= Received: by 10.35.97.17 with SMTP id z17mr8995503pyl.1164991250625; Fri, 01 Dec 2006 08:40:50 -0800 (PST) Received: by 10.35.80.10 with HTTP; Fri, 1 Dec 2006 08:40:50 -0800 (PST) Message-ID: Date: Fri, 1 Dec 2006 22:10:50 +0530 From: "Rajesh Kumar Mallah" To: pgsql-sql@postgresql.org Subject: calling elog possibly causing problem in DirectFunctionCall1 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_5104_4161930.1164991250538" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/9 X-Sequence-Number: 26965 ------=_Part_5104_4161930.1164991250538 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi , In certain C trigger function following code snippet causes ERROR: --------------------------------------------------- elog (NOTICE , "before calling DirectFunctionCall1"); data->time_stamp = DirectFunctionCall1(timestamptz_in, CStringGetDatum("now")); elog (NOTICE , "after calling DirectFunctionCall1"); ---------------------------------------------------- begin work;INSERT INTO audittest.test_table (name,foo) values ('test','test'); rollback; BEGIN NOTICE: before calling DirectFunctionCall1 ERROR: timestamp(-1073748880) precision must be between 0 and 6 ROLLBACK If the elog before DirectFunctionCall1 is removed the code works fine. begin work;INSERT INTO audittest.test_table (name,foo) values ('test','test'); rollback; BEGIN NOTICE: after calling DirectFunctionCall1 INSERT 0 1 ROLLBACK Can anyone please explain how removing a elog makes a difference? Regds Mallah. ------=_Part_5104_4161930.1164991250538 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi ,
In certain C trigger function following code snippet causes ERROR:
---------------------------------------------------
elog (NOTICE , "before calling DirectFunctionCall1");
  data->time_stamp =
    DirectFunctionCall1(timestamptz_in, CStringGetDatum("now"));
elog (NOTICE , "after calling DirectFunctionCall1");
----------------------------------------------------

begin work;INSERT INTO  audittest.test_table (name,foo) values ('test','test'); rollback;
BEGIN
NOTICE:  before calling DirectFunctionCall1
ERROR:  timestamp(-1073748880) precision must be between 0 and 6
ROLLBACK

If the elog before DirectFunctionCall1 is removed the code works fine.

begin work;INSERT INTO  audittest.test_table (name,foo) values ('test','test'); rollback;
BEGIN
NOTICE:  after calling DirectFunctionCall1
INSERT 0 1
ROLLBACK

Can anyone please explain how removing a elog makes a difference?

Regds
Mallah.






------=_Part_5104_4161930.1164991250538--