Re: Re: Date of creation and of change - Mailing list pgsql-sql

From Tom Lane
Subject Re: Re: Date of creation and of change
Date
Msg-id 28092.967041358@sss.pgh.pa.us
Whole thread Raw
In response to Re: Date of creation and of change  (Andreas Tille <tillea@rki.de>)
List pgsql-sql
Andreas Tille <tillea@rki.de> writes:
> On Wed, 23 Aug 2000, hlefebvre wrote:
>> create table mytable( CreateDate  timestamp default timestamp('now'),
>> ....);  
> I've done a pg_dump <mydb> and there this line was transformed to:

>   "createdat" timestamp DEFAULT '23.08.2000 15:35:16.00 CEST'::"timestamp",

This approach does not work in 7.0 (I think it did work in some prior
releases, but not recently).  The recommended method is shown in the
FAQ:     4.22) How do I create a column that will default to the current time?     Use now():       CREATE TABLE test
(xint, modtime timestamp default now() );
 

        regards, tom lane


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Using SETOF in plpgsql function
Next
From: "Adam Lang"
Date:
Subject: Copy To - fixed width