Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.10.1/8.10.1) with ESMTP id e7NEaDN34953 for ; Wed, 23 Aug 2000 10:36:13 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id KAA28095; Wed, 23 Aug 2000 10:35:58 -0400 (EDT) To: Andreas Tille cc: hlefebvre , PostgreSQL SQL Subject: Re: Re: Date of creation and of change In-reply-to: References: Comments: In-reply-to Andreas Tille message dated "Wed, 23 Aug 2000 15:53:35 +0200" Date: Wed, 23 Aug 2000 10:35:58 -0400 Message-ID: <28092.967041358@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200008/249 Andreas Tille writes: > On Wed, 23 Aug 2000, hlefebvre wrote: >> create table mytable( CreateDate timestamp default timestamp('now'), >> ....); > I've done a pg_dump 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 (x int, modtime timestamp default now() ); regards, tom lane