Niladic functions

From: "D'Arcy" "J(dot)M(dot)" Cain <darcy(at)druid(dot)net>
To: pgsql-hackers(at)PostgreSQL(dot)org
Subject: Niladic functions
Date: 1999-03-08 16:50:24
Message-ID: m10K3EW-0000buC@druid.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The "Integrated Document" on the web page has the following paragraph in
the section "CREATE TABLE" in chapter 20.

In the current release (v6.4), 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.

This appears to be untrue. Is this a change since 6.4 or is there
some cases where using CURRENT_TIMESTAMP will not do the expected thing?

Also, the title of the document (The PostgreSQL Development Team) seems
to be incorrect.

--
D'Arcy J.M. Cain <darcy(at){druid|vex}.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 424 2871 (DoD#0082) (eNTP) | what's for dinner.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-03-08 17:34:27 Developers globe
Previous Message Tom Lane 1999-03-08 15:32:04 Re: [HACKERS] What's happened with 1942