Re: In 7.4 ensure you have DEFAULT now () with no spaces - Mailing list pgsql-sql

From Peter Eisentraut
Subject Re: In 7.4 ensure you have DEFAULT now () with no spaces
Date
Msg-id 200406191425.43379.peter_e@gmx.net
Whole thread Raw
In response to In 7.4 ensure you have DEFAULT now () with no spaces  ("David B" <postgresql@thegatelys.com>)
Responses Re: In 7.4 ensure you have DEFAULT now () with no spaces
List pgsql-sql
David B wrote:
> We had been testing 7.4 for a few days and just noticed that some
> tables had created_timestamp rows with a date/time of the date the DB
> was created...not the date/time the insert was done.
>
> Looking at those tables the create DDL's for those few tables
> contained now ()
> as in:
>
> created_timestamp  timestamp DEFAULT now ()   -- note the space
> between now and ()
>
> Most had correctly been defined without the space - as in now()

Whatever it was, that was not the problem.  With 7.4.1:

peter=# create table test1 (foo text, create_timestamp timestamp default now());
CREATE TABLE
peter=# create table test2 (foo text, create_timestamp timestamp default now ());
CREATE TABLE
peter=# create table test3 (foo text, create_timestamp timestamp default now
peter(# /* blah */
peter(# (
peter(# /* blah */
peter(# )
peter(# )
peter-# ;
CREATE TABLE
peter=# \d test1                     Table "public.test1"     Column      |            Type             |   Modifiers
------------------+-----------------------------+---------------foo              | text
|create_timestamp| timestamp without time zone | default now()
 

peter=# \d test2                     Table "public.test2"     Column      |            Type             |   Modifiers
------------------+-----------------------------+---------------foo              | text
|create_timestamp| timestamp without time zone | default now()
 

peter=# \d test3                     Table "public.test3"     Column      |            Type             |   Modifiers
------------------+-----------------------------+---------------foo              | text
|create_timestamp| timestamp without time zone | default now()
 

They're all identical.



pgsql-sql by date:

Previous
From: "V i s h a l Kashyap @ [Sai Hertz And Control Systems]"
Date:
Subject: Re: case stement when null
Next
From: Tom Lane
Date:
Subject: Re: plpgsql - Insert from a record variable?