pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rajesh Kumar Mallah <mallah.rajesh@gmail.com>
To: pgsql-sql@postgresql.org
Subject: calling elog possibly causing problem in DirectFunctionCall1
Date: Fri, 1 Dec 2006 22:10:50 +0530
Message-ID: <a97c77030612010840o3436b7bcje1cdfc507c009f3b@mail.gmail.com> (raw)

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.

view thread (4+ messages)  latest in thread

Message-ID: <a97c77030612010840o3436b7bcje1cdfc507c009f3b@mail.gmail.com>
Permalink:  ../a97c77030612010840o3436b7bcje1cdfc507c009f3b@mail.gmail.com/
Also on:    postgresql.org/message-id/a97c77030612010840o3436b7bcje1cdfc507c009f3b@mail.gmail.com

 · 

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-sql@postgresql.org
  Cc: mallah.rajesh@gmail.com
  Subject: Re: calling elog possibly causing problem in DirectFunctionCall1
  In-Reply-To: <a97c77030612010840o3436b7bcje1cdfc507c009f3b@mail.gmail.com>

* 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