From: hlefebvre <hlefebvre@lexbase.net>
To: Andreas Tille <tillea@rki.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL SQL <pgsql-sql@hub.org>
Subject: Re: Re: Date of creation and of change
Date: Fri, 25 Aug 2000 17:22:26 +0200
Message-ID: <39A68F32.7C781690@lexbase.net> (raw)
References: <Pine.LNX.4.21.0008251647210.716-100000@wr-linux02.rki.de>
Andreas Tille wrote:
>
> On Fri, 25 Aug 2000, Tom Lane wrote:
>
> > I think you are getting burnt by premature constant folding --- see
> > nearby discussion of how to define a column default that gives the
> > time of insertion. You need to write this as
> > NEW.ChangedAt := now();
> > to prevent the system from reducing timestamp('now') to a constant
> > when the function is first executed.
> This doesn't work, too.
> It just puts allways the constant time when the function was created
> into the database. May be it has to be escaped in somw way??
>
> I don't know how to follow hlefebvre's hint to "put null" into the
> field.
As I said, I was wrong, and Tom is right.
I was suspecting a problem if the field is not used in the query, but
the pb was about the now() function.
> Bay the way: If we once solved the problem it might be a topic for
> the FAQ, perhaps?
IMHO this is a documentation problem.
There is no example about such trigger who will modify data, and 'now'
is described as "transaction time".
also, in date/time function now() is not mentionned
(doc about pgSQL 7.0 on the web site at
http://www.postgresql.org/users-lounge/docs/7.0/user/functions2872.htm)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: hlefebvre@lexbase.net, tillea@rki.de, tgl@sss.pgh.pa.us, pgsql-sql@hub.org
Subject: Re: Date of creation and of change
In-Reply-To: <39A68F32.7C781690@lexbase.net>
References: <Pine.LNX.4.21.0008251647210.716-100000@wr-linux02.rki.de> <39A68F32.7C781690@lexbase.net>
* 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