pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter_e@gmx.net>
To: David B <postgresql@thegatelys.com>
To: pgsql-sql@postgresql.org
Subject: Re: In 7.4 ensure you have DEFAULT now () with no spaces
Date: Sat, 19 Jun 2004 14:25:43 +0200
Message-ID: <200406191425.43379.peter_e@gmx.net> (raw)
In-Reply-To: <GOEGKICPFOPNLIEIHGFJEEMMCNAA.postgresql@thegatelys.com>
References: <GOEGKICPFOPNLIEIHGFJEEMMCNAA.postgresql@thegatelys.com>

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.




view thread (3+ messages)  latest in thread

Message-ID: <200406191425.43379.peter_e@gmx.net>
Permalink:  ../200406191425.43379.peter_e@gmx.net/
Also on:    postgresql.org/message-id/200406191425.43379.peter_e@gmx.net

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: peter_e@gmx.net, postgresql@thegatelys.com
  Subject: Re: In 7.4 ensure you have DEFAULT now () with no spaces
  In-Reply-To: <200406191425.43379.peter_e@gmx.net>

* 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