pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andreas Tille <tillea@rki.de>
Cc: hlefebvre <hlefebvre@lexbase.net>
Cc: PostgreSQL SQL <pgsql-sql@hub.org>
Subject: Re: Re: Date of creation and of change
Date: Wed, 23 Aug 2000 10:35:58 -0400
Message-ID: <28092.967041358@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.21.0008231549340.22247-100000@wr-linux02.rki.de>
References: <Pine.LNX.4.21.0008231549340.22247-100000@wr-linux02.rki.de>

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 (x int, modtime timestamp default now() );


			regards, tom lane



view thread (15+ messages)  latest in thread

Message-ID: <28092.967041358@sss.pgh.pa.us>
Permalink:  ../28092.967041358@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/28092.967041358@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, tillea@rki.de, hlefebvre@lexbase.net, pgsql-sql@hub.org
  Subject: Re: Date of creation and of change
  In-Reply-To: <28092.967041358@sss.pgh.pa.us>
  References: <Pine.LNX.4.21.0008231549340.22247-100000@wr-linux02.rki.de> <28092.967041358@sss.pgh.pa.us>

* 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