Ambiguous/Inaccurate example in users guide

From: "Hutton, Rob" <HuttonR(at)plymart(dot)com>
To: "'pgsql-docs(at)postgresql(dot)org'" <pgsql-docs(at)postgreSQL(dot)org>
Subject: Ambiguous/Inaccurate example in users guide
Date: 1999-08-10 16:24:14
Message-ID: 11EFC736FB68D111B9DD00805FAD7C6D1E0C22@plymartpdc.internal.plymart.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

In the users Manual - Create Table - Default Clause - niladic function
section:

In the current release (v6.5), Postgres evaluates all default expressions at
the time the table is defined. Hence, functions which are "non-cacheable"
such as CURRENT_TIMESTAMP may not produce the desired effect. For the
particular case of date/time types, one can work around this behavior by
using "DEFAULT TEXT 'now'" instead of "DEFAULT 'now'" or "DEFAULT
CURRENT_TIMESTAMP". This forces Postgres to consider the constant a string
type and then to convert the value to timestamp at runtime.

The second sentence states that you may not get the desired effect, but
does state what the desired effect is nor what the undesired effect is. So
the way I read it was if you don't use the "TEXT 'now'", you'll get the time
and date the database was created in every record. You still get this with
the "DEFAULT TEXT 'now'" the now should be now() to get the time or date
the record was created.
I don't subscribe to the list, so please contact me directly.

Rob Hutton
MIS Technical Director
Ply Marts, Inc.

Browse pgsql-docs by date

  From Date Subject
Next Message Hub.Org News Admin 1999-08-11 01:02:49
Previous Message Thomas Lockhart 1999-08-10 13:14:58 Re: Pronunciation of "PostgreSQL" (was: Re: [HACKERS] New man pages)