timestamp and time now support precision

From: Thomas Lockhart <lockhart(at)fourpalms(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: timestamp and time now support precision
Date: 2001-10-03 05:41:34
Message-ID: 3BBAA50E.946C91F5@fourpalms.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I've implemented timestamp and time precision per SQL99 spec. The syntax
is

TIMESTAMP(2) WITH TIME ZONE
or
TIME(0)
etc etc.

One result of this is that "timestamp" is no longer a valid external
function name (among other things) due to parser ambiguity between

TIMESTAMP(2)

and, say,

TIMESTAMP(date 'today')

(the latter used to be supported). If you need to explicitly call a
function by that name you need to surround the function name with double
quotes, as in

select "timestamp"(date 'today');

All regression tests pass, though we will probably need updates to the
"pre-1970" regression results. The CVS notes follow...

- Thomas

Implement precision support for timestamp and time, both with and
without time zones.
SQL99 spec requires a default of zero (round to seconds) which is set in
gram.y as typmod is set in the parse tree. We *could* change to a
default of either 6 (for internal compatibility with previous versions)
or 2 (for external compatibility with previous versions).
Evaluate entries in pg_proc wrt the iscachable attribute for timestamp
and other date/time types. Try to recognize cases where side effects
like the current time zone setting may have an effect on results to
decide whether something is cachable or not.

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2001-10-03 07:12:57 Re: Unicode combining characters
Previous Message Tom Lane 2001-10-03 04:14:47 Re: Unicode combining characters