Ambiguous/Inaccurate example in users guide - Mailing list pgsql-docs

From Hutton, Rob
Subject Ambiguous/Inaccurate example in users guide
Date
Msg-id 11EFC736FB68D111B9DD00805FAD7C6D1E0C22@plymartpdc.internal.plymart.com
Whole thread Raw
List 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.

pgsql-docs by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: New docbook2man-spec.pl patches
Next
From: "Hub.Org News Admin"
Date:
Subject: ...