From: Tom Lane <tgl@sss.pgh.pa.us>
To: deedham@pbo.net
Cc: pgsql-admin@postgresql.org
Subject: Re: Bad timestamp 7.1->7.2
Date: Fri, 22 Feb 2002 12:49:10 -0500
Message-ID: <17922.1014400150@sss.pgh.pa.us> (raw)
In-Reply-To: <200202221553.g1MFrbb30865@pbo.net>
References: <200202221553.g1MFrbb30865@pbo.net>
Doug Needham <dneedham@pbo.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
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-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, deedham@pbo.net
Subject: Re: Bad timestamp 7.1->7.2
In-Reply-To: <17922.1014400150@sss.pgh.pa.us>
References: <200202221553.g1MFrbb30865@pbo.net> <17922.1014400150@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