Ambiguous/Inaccurate example in users guide

Поиск
Список
Период
Сортировка
От Hutton, Rob
Тема Ambiguous/Inaccurate example in users guide
Дата
Msg-id 11EFC736FB68D111B9DD00805FAD7C6D1E0C22@plymartpdc.internal.plymart.com
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: Thomas Lockhart
Дата:
Сообщение: Re: New docbook2man-spec.pl patches
Следующее
От: "Hub.Org News Admin"
Дата:
Сообщение: ...