aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/variable.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2003-12-20 15:32:55 +0000
committerBruce Momjian <bruce@momjian.us>2003-12-20 15:32:55 +0000
commit54c8e821b8313c78ba19653f74e83e956fdb8fe5 (patch)
treeca8409fb0a0a20e84b19accd2351192553120c3f /src/backend/commands/variable.c
parent7be614a087019bb0ed566e295bfbd47f1dd22cd0 (diff)
downloadpostgresql-54c8e821b8313c78ba19653f74e83e956fdb8fe5.tar.gz
postgresql-54c8e821b8313c78ba19653f74e83e956fdb8fe5.zip
In my mind there were two categories of open issues
a) ones that are 100% backward (such as the comment about outputting this format) and b) ones that aren't (such as deprecating the current postgresql shorthand of '1Y1M'::interval = 1 year 1 minute in favor of the ISO-8601 'P1Y1M'::interval = 1 year 1 month. Attached is a patch that addressed all the discussed issues that did not break backward compatability, including the ability to output ISO-8601 compliant intervals by setting datestyle to iso8601basic. Interval values can now be written as ISO 8601 time intervals, using the "Format with time-unit designators". This format always starts with the character 'P', followed by a string of values followed by single character time-unit designators. A 'T' separates the date and time parts of the interval. Ron Mayer
Diffstat (limited to 'src/backend/commands/variable.c')
-rw-r--r--src/backend/commands/variable.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c
index 1923b1f2d5a..8b2b44ab8e0 100644
--- a/src/backend/commands/variable.c
+++ b/src/backend/commands/variable.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/variable.c,v 1.90 2003/11/29 19:51:48 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/variable.c,v 1.91 2003/12/20 15:32:54 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -82,7 +82,12 @@ assign_datestyle(const char *value, bool doit, bool interactive)
/* Ugh. Somebody ought to write a table driven version -- mjl */
- if (strcasecmp(tok, "ISO") == 0)
+ if (strcasecmp(tok, "ISO8601BASIC") == 0)
+ {
+ newDateStyle = USE_ISO8601BASIC_DATES;
+ scnt++;
+ }
+ else if (strcasecmp(tok, "ISO") == 0)
{
newDateStyle = USE_ISO_DATES;
scnt++;
@@ -198,6 +203,9 @@ assign_datestyle(const char *value, bool doit, bool interactive)
case USE_ISO_DATES:
strcpy(result, "ISO");
break;
+ case USE_ISO8601BASIC_DATES:
+ strcpy(result, "ISO8601BASIC");
+ break;
case USE_SQL_DATES:
strcpy(result, "SQL");
break;