diff options
author | Thomas G. Lockhart <lockhart@fourpalms.org> | 2001-09-28 08:09:14 +0000 |
---|---|---|
committer | Thomas G. Lockhart <lockhart@fourpalms.org> | 2001-09-28 08:09:14 +0000 |
commit | 6f58115dddfa8ca63004c4784f57ef660422861d (patch) | |
tree | 71816e03286e53113ec4b6de337f0b345028a314 /src/backend/parser/parse_coerce.c | |
parent | 1f075a32ee28004251f508f50a4325944801da10 (diff) | |
download | postgresql-6f58115dddfa8ca63004c4784f57ef660422861d.tar.gz postgresql-6f58115dddfa8ca63004c4784f57ef660422861d.zip |
Measure the current transaction time to milliseconds.
Define a new function, GetCurrentTransactionStartTimeUsec() to get the time
to this precision.
Allow now() and timestamp 'now' to use this higher precision result so
we now have fractional seconds in this "constant".
Add timestamp without time zone type.
Move previous timestamp type to timestamp with time zone.
Accept another ISO variant for date/time values: yyyy-mm-ddThh:mm:ss
(note the "T" separating the day from hours information).
Remove 'current' from date/time types; convert to 'now' in input.
Separate time and timetz regression tests.
Separate timestamp and timestamptz regression test.
Diffstat (limited to 'src/backend/parser/parse_coerce.c')
-rw-r--r-- | src/backend/parser/parse_coerce.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/backend/parser/parse_coerce.c b/src/backend/parser/parse_coerce.c index 5f769a81eac..80164f86b3a 100644 --- a/src/backend/parser/parse_coerce.c +++ b/src/backend/parser/parse_coerce.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.60 2001/06/24 02:41:21 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.61 2001/09/28 08:09:09 thomas Exp $ * *------------------------------------------------------------------------- */ @@ -240,7 +240,7 @@ can_coerce_type(int nargs, Oid *input_typeids, Oid *func_typeids) oid_array[0] = inputTypeId; ftup = SearchSysCache(PROCNAME, - PointerGetDatum(typeidTypeName(targetTypeId)), + PointerGetDatum(typeidTypeName(targetTypeId)), Int32GetDatum(1), PointerGetDatum(oid_array), 0); @@ -498,6 +498,7 @@ TypeCategory(Oid inType) case (TIMETZOID): case (ABSTIMEOID): case (TIMESTAMPOID): + case (TIMESTAMPTZOID): result = DATETIME_TYPE; break; @@ -577,7 +578,10 @@ PreferredType(CATEGORY category, Oid type) break; case (DATETIME_TYPE): - result = TIMESTAMPOID; + if (type == DATEOID) + result = TIMESTAMPOID; + else + result = TIMESTAMPTZOID; break; case (TIMESPAN_TYPE): @@ -634,10 +638,14 @@ PromoteTypeToNext(Oid inType) break; case (DATEOID): - case (ABSTIMEOID): result = TIMESTAMPOID; break; + case (ABSTIMEOID): + case (TIMESTAMPOID): + result = TIMESTAMPTZOID; + break; + case (TIMEOID): case (RELTIMEOID): result = INTERVALOID; @@ -646,7 +654,7 @@ PromoteTypeToNext(Oid inType) case (BOOLOID): case (TEXTOID): case (FLOAT8OID): - case (TIMESTAMPOID): + case (TIMESTAMPTZOID): case (INTERVALOID): default: result = inType; |