From: Gaetano Mendola <mendola@bigfoot.com>
To: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Re: Now() in a function
Date: Fri, 07 Nov 2003 00:19:12 +0100
Message-ID: <3FAAD6F0.4080907@bigfoot.com> (raw)
In-Reply-To: <Sea1-DAV35ZvgK27nKz00012c5b@hotmail.com>
References: <Sea1-DAV35ZvgK27nKz00012c5b@hotmail.com>
sTesting wrote:
> Hi,
>
> I have a big problem, i wrote a very long function that is taking so
> much time. inside this function i added few debugging steps to find
> which section is taking most of the time, but all the created records
> have the same time in them, the time where the fuction begins.
> I tried to different methods:
> INSERT INTO f_error (error_id, creation_date)
> VALUES (nextval(''s_f_error_id''), now());
>
> INSERT INTO f_error (error_id, creation_date)
> VALUES (nextval(''s_f_error_id''), ''now'');
now() give you the time when the transaction started,
so what you see is the intended behavior, in your case you must use:
timeofday().
Regards
Gaetano Mendola
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: mendola@bigfoot.com
Subject: Re: Now() in a function
In-Reply-To: <3FAAD6F0.4080907@bigfoot.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