Skip site navigation (1) Skip section navigation (2)

Re: Bad timestamp 7.1->7.2

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: deedham(at)pbo(dot)net
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Bad timestamp 7.1->7.2
Date: 2002-02-22 17:49:10
Message-ID: 17922.1014400150@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-admin
Doug Needham <dneedham(at)pbo(dot)net> writes:
> I created a database on postgres 7.1 
> one of the fields was defined with a default of : 
> 'select now()::"timestamp"
> When I try to create this table under 7.2 it fails. 

Hmm, looks fine to me:

regression=# create table foobar (f1 timestamp default now()::"timestamp");
CREATE
regression=# insert into foobar default values;
INSERT 401822 1
regression=# select * from foobar;
              f1
-------------------------------
 2002-02-22 12:45:39.189714-05
(1 row)

Could you be more exact in your description of what you entered and what
problem you saw?

Personally I'd just say "default now()", or "default current_timestamp"
if I wanted to be SQL92-correct, but the cast should be okay too.

			regards, tom lane

In response to

pgsql-admin by date

Next:From: Gaetano MendolaDate: 2002-02-22 17:50:21
Subject: Re: Builded Postgresql 7.2 for Redhat 7.1
Previous:From: Stephan SzaboDate: 2002-02-22 16:17:11
Subject: Re: Client Authentication

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group