diff options
| author | Thomas G. Lockhart | 2001-10-18 17:30:21 +0000 |
|---|---|---|
| committer | Thomas G. Lockhart | 2001-10-18 17:30:21 +0000 |
| commit | 9310075a13c28fc77224094d2cf3cc1c03446b4a (patch) | |
| tree | 64e430f8525c5782e26d3ddede403829836909c6 /src/include | |
| parent | 6254465d0621f724cdc9a1e99da24fa8a29f579d (diff) | |
Accept an INTERVAL argument for SET TIME ZONE per SQL99.
Modified the parser and the SET handlers to use full Node structures
rather than simply a character string argument.
Implement INTERVAL() YEAR TO MONTH (etc) syntax per SQL99.
Does not yet accept the goofy string format that goes along with, but
this should be fairly straight forward to fix now as a bug or later
as a feature.
Implement precision for the INTERVAL() type.
Use the typmod mechanism for both of INTERVAL features.
Fix the INTERVAL syntax in the parser:
opt_interval was in the wrong place.
INTERVAL is now a reserved word, otherwise we get reduce/reduce errors.
Implement an explicit date_part() function for TIMETZ.
Should fix coersion problem with INTERVAL reported by Peter E.
Fix up some error messages for date/time types.
Use all caps for type names within message.
Fix recently introduced side-effect bug disabling 'epoch' as a recognized
field for date_part() etc. Reported by Peter E. (??)
Bump catalog version number.
Rename "microseconds" current transaction time field
from ...Msec to ...Usec. Duh!
date/time regression tests updated for reference platform, but a few
changes will be necessary for others.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/access/xact.h | 4 | ||||
| -rw-r--r-- | src/include/catalog/catversion.h | 4 | ||||
| -rw-r--r-- | src/include/catalog/pg_proc.h | 10 | ||||
| -rw-r--r-- | src/include/commands/variable.h | 4 | ||||
| -rw-r--r-- | src/include/nodes/parsenodes.h | 4 | ||||
| -rw-r--r-- | src/include/utils/date.h | 3 | ||||
| -rw-r--r-- | src/include/utils/nabstime.h | 4 | ||||
| -rw-r--r-- | src/include/utils/timestamp.h | 3 |
8 files changed, 19 insertions, 17 deletions
diff --git a/src/include/access/xact.h b/src/include/access/xact.h index be5e9db665..557e0768c3 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: xact.h,v 1.37 2001/09/28 08:09:12 thomas Exp $ + * $Id: xact.h,v 1.38 2001/10/18 17:30:15 thomas Exp $ * *------------------------------------------------------------------------- */ @@ -40,7 +40,7 @@ typedef struct TransactionStateData CommandId commandId; CommandId scanCommandId; AbsoluteTime startTime; - int startTimeMsec; + int startTimeUsec; int state; int blockState; } TransactionStateData; diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index 790bb6cf5c..92eb1961fd 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -37,7 +37,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: catversion.h,v 1.98 2001/10/03 17:22:05 tgl Exp $ + * $Id: catversion.h,v 1.99 2001/10/18 17:30:15 thomas Exp $ * *------------------------------------------------------------------------- */ @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 200110031 +#define CATALOG_VERSION_NO 200110181 #endif diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index 7f179d9630..5efc7bed03 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_proc.h,v 1.216 2001/10/12 02:08:34 ishii Exp $ + * $Id: pg_proc.h,v 1.217 2001/10/18 17:30:15 thomas Exp $ * * NOTES * The script catalog/genbki.sh reads this file and generates .bki @@ -1434,7 +1434,6 @@ DATA(insert OID = 1171 ( date_part PGUID 12 f t f t 2 f 701 "25 1184" 100 DESCR("extract field from timestamp with time zone"); DATA(insert OID = 1172 ( date_part PGUID 12 f t t t 2 f 701 "25 1186" 100 0 0 100 interval_part - )); DESCR("extract field from interval"); - DATA(insert OID = 1173 ( timestamptz PGUID 12 f t f t 1 f 1184 "702" 100 0 0 100 abstime_timestamptz - )); DESCR("convert abstime to timestamp with time zone"); DATA(insert OID = 1174 ( timestamptz PGUID 12 f t f t 1 f 1184 "1082" 100 0 0 100 date_timestamptz - )); @@ -1523,7 +1522,8 @@ DATA(insert OID = 1271 ( overlaps PGUID 12 f t t f 4 f 16 "1266 1266 1266 1 DESCR("SQL92 interval comparison"); DATA(insert OID = 1272 ( datetime_pl PGUID 12 f t t t 2 f 1114 "1082 1083" 100 0 0 100 datetime_timestamp - )); DESCR("convert date and time to timestamp"); - +DATA(insert OID = 1273 ( date_part PGUID 12 f t t t 2 f 701 "25 1266" 100 0 0 100 timetz_part - )); +DESCR("extract field from time with time zone"); DATA(insert OID = 1274 ( int84pl PGUID 12 f t t t 2 f 20 "20 23" 100 0 0 100 int84pl - )); DESCR("add"); DATA(insert OID = 1275 ( int84mi PGUID 12 f t t t 2 f 20 "20 23" 100 0 0 100 int84mi - )); @@ -1709,11 +1709,11 @@ DESCR("length"); DATA(insert OID = 1382 ( date_part PGUID 14 f t f t 2 f 701 "25 702" 100 0 0 100 "select date_part($1, timestamptz($2))" - )); DESCR("extract field from abstime"); -DATA(insert OID = 1383 ( date_part PGUID 14 f t f t 2 f 701 "25 703" 100 0 0 100 "select date_part($1, interval($2))" - )); +DATA(insert OID = 1383 ( date_part PGUID 14 f t f t 2 f 701 "25 703" 100 0 0 100 "select date_part($1, cast($2 as interval))" - )); DESCR("extract field from reltime"); DATA(insert OID = 1384 ( date_part PGUID 14 f t t t 2 f 701 "25 1082" 100 0 0 100 "select date_part($1, cast($2 as timestamp without time zone))" - )); DESCR("extract field from date"); -DATA(insert OID = 1385 ( date_part PGUID 14 f t t t 2 f 701 "25 1083" 100 0 0 100 "select date_part($1, interval($2))" - )); +DATA(insert OID = 1385 ( date_part PGUID 14 f t t t 2 f 701 "25 1083" 100 0 0 100 "select date_part($1, cast($2 as time with time zone))" - )); DESCR("extract field from time"); DATA(insert OID = 1386 ( age PGUID 14 f t f t 1 f 1186 "1184" 100 0 0 100 "select age(cast(current_date as timestamp with time zone), $1)" - )); DESCR("date difference from today preserving months and years"); diff --git a/src/include/commands/variable.h b/src/include/commands/variable.h index c1e9541e5a..75e88b806b 100644 --- a/src/include/commands/variable.h +++ b/src/include/commands/variable.h @@ -2,13 +2,13 @@ * Headers for handling of 'SET var TO', 'SHOW var' and 'RESET var' * statements * - * $Id: variable.h,v 1.13 2000/10/26 17:31:33 tgl Exp $ + * $Id: variable.h,v 1.14 2001/10/18 17:30:16 thomas Exp $ * */ #ifndef VARIABLE_H #define VARIABLE_H -extern void SetPGVariable(const char *name, const char *value); +extern void SetPGVariable(const char *name, List *args); extern void GetPGVariable(const char *name); extern void ResetPGVariable(const char *name); diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 44961bcca9..ef6c9c63b5 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: parsenodes.h,v 1.146 2001/10/12 00:07:15 tgl Exp $ + * $Id: parsenodes.h,v 1.147 2001/10/18 17:30:16 thomas Exp $ * *------------------------------------------------------------------------- */ @@ -736,7 +736,7 @@ typedef struct VariableSetStmt { NodeTag type; char *name; - char *value; + List *args; } VariableSetStmt; /* ---------------------- diff --git a/src/include/utils/date.h b/src/include/utils/date.h index 2698fc90d4..0e1aa14128 100644 --- a/src/include/utils/date.h +++ b/src/include/utils/date.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: date.h,v 1.13 2001/10/03 05:29:25 thomas Exp $ + * $Id: date.h,v 1.14 2001/10/18 17:30:16 thomas Exp $ * *------------------------------------------------------------------------- */ @@ -118,6 +118,7 @@ extern Datum timestamptz_timetz(PG_FUNCTION_ARGS); extern Datum datetimetz_timestamptz(PG_FUNCTION_ARGS); extern Datum text_timetz(PG_FUNCTION_ARGS); extern Datum timetz_text(PG_FUNCTION_ARGS); +extern Datum timetz_part(PG_FUNCTION_ARGS); extern Datum timetz_zone(PG_FUNCTION_ARGS); extern Datum timetz_izone(PG_FUNCTION_ARGS); extern Datum timetz_pl_interval(PG_FUNCTION_ARGS); diff --git a/src/include/utils/nabstime.h b/src/include/utils/nabstime.h index 299c7dbc60..b7aaf0d0ac 100644 --- a/src/include/utils/nabstime.h +++ b/src/include/utils/nabstime.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: nabstime.h,v 1.31 2001/09/28 08:09:14 thomas Exp $ + * $Id: nabstime.h,v 1.32 2001/10/18 17:30:16 thomas Exp $ * *------------------------------------------------------------------------- */ @@ -158,6 +158,6 @@ extern Datum timeofday(PG_FUNCTION_ARGS); /* non-fmgr-callable support routines */ extern AbsoluteTime GetCurrentAbsoluteTime(void); extern AbsoluteTime GetCurrentAbsoluteTimeUsec(int *usec); -extern void abstime2tm(AbsoluteTime time, int *tzp, struct tm * tm, char *tzn); +extern void abstime2tm(AbsoluteTime time, int *tzp, struct tm * tm, char **tzn); #endif /* NABSTIME_H */ diff --git a/src/include/utils/timestamp.h b/src/include/utils/timestamp.h index 1a5f28f592..1e193bed3b 100644 --- a/src/include/utils/timestamp.h +++ b/src/include/utils/timestamp.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: timestamp.h,v 1.20 2001/10/03 15:42:12 tgl Exp $ + * $Id: timestamp.h,v 1.21 2001/10/18 17:30:16 thomas Exp $ * *------------------------------------------------------------------------- */ @@ -105,6 +105,7 @@ extern Datum timestamp_larger(PG_FUNCTION_ARGS); extern Datum interval_in(PG_FUNCTION_ARGS); extern Datum interval_out(PG_FUNCTION_ARGS); +extern Datum interval_scale(PG_FUNCTION_ARGS); extern Datum interval_eq(PG_FUNCTION_ARGS); extern Datum interval_ne(PG_FUNCTION_ARGS); extern Datum interval_lt(PG_FUNCTION_ARGS); |
