Setting current time on insert

From: "Bryan White" <bryan(at)arcamax(dot)com>
To: <pgsql-sql(at)hub(dot)org>
Subject: Setting current time on insert
Date: 1998-09-28 14:50:27
Message-ID: 00a401bdeaef$54d265c0$a3f0f6ce@bryan.arcamax.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I have a table with a column defined as:
Date timestamp not null default 'now'
The intent was to set the field to the data/time the row was created. The
result seems to be that 'now' is evaluated when the table is created and all
records get this value. Is there a way to defer evaluation of the column
default until a record is inserted?

Bryan White
ArcaMax Inc.
Yorktown VA
www.arcamax.com

Browse pgsql-sql by date

  From Date Subject
Next Message Herouth Maoz 1998-09-28 16:20:54 Re: [SQL] Re: Another nut to crack with insertion into tables... *sigh*
Previous Message Tom Lane 1998-09-28 14:02:10 Re: Another nut to crack with insertion into tables... *sigh*