Re: Date of creation and of change

From: Andreas Tille <tillea(at)rki(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: hlefebvre <hlefebvre(at)lexbase(dot)net>, PostgreSQL SQL <pgsql-sql(at)hub(dot)org>
Subject: Re: Date of creation and of change
Date: 2000-08-25 14:50:07
Message-ID: Pine.LNX.4.21.0008251647210.716-100000@wr-linux02.rki.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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.

Bay the way: If we once solved the problem it might be a topic for
the FAQ, perhaps?

Kind regards

Andreas.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Andreas Tille 2000-08-25 14:59:59 Re: Date of creation and of change
Previous Message hlefebvre 2000-08-25 14:46:36 Re: Re: Date of creation and of change