| From: | Michael Fuhr <mike(at)fuhr(dot)org> |
|---|---|
| To: | Oliver Elphick <olly(at)lfix(dot)co(dot)uk> |
| Cc: | pgsql-bugs(at)postgresql(dot)org |
| Subject: | Re: Problem with COPY in 8.0.3 |
| Date: | 2005-10-12 20:26:32 |
| Message-ID: | 20051012202632.GA50746@winnie.fuhr.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
On Wed, Oct 12, 2005 at 08:23:15PM +0100, Oliver Elphick wrote:
> On Wed, 2005-10-12 at 12:13 -0600, Michael Fuhr wrote:
> > On another note, regarding the following:
> >
> > > invdate | date | not null default ('now'::text)::date
> > > taxpoint | date | not null default ('now'::text)::date
> >
> > Are you sure you want 'now'::text as a default, considering the
> > warning against it?
>
> I actually use CURRENT_DATE; that is what the system turns it into.
Ah yes, I see that now. I generally use now(), so I hadn't noticed
that CURRENT_DATE and CURRENT_TIMESTAMP become 'now', whereas only
a literal 'now' is expanded at create time:
CREATE TABLE foo (
d1 date NOT NULL DEFAULT now(),
d2 date NOT NULL DEFAULT CURRENT_DATE,
d3 date NOT NULL DEFAULT 'now'
);
\d foo
Table "public.foo"
Column | Type | Modifiers
--------+------+--------------------------------------
d1 | date | not null default now()
d2 | date | not null default ('now'::text)::date
d3 | date | not null default '2005-10-12'::date
--
Michael Fuhr
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Michael Fuhr | 2005-10-12 20:40:27 | Re: Problem with COPY in 8.0.3 |
| Previous Message | Peter Bazeley | 2005-10-12 19:39:15 | building Postgresql 7.3.10 on Mac OS X 10.4 |