1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-14 18:42:34 +03:00

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
This commit is contained in:
Bruce Momjian
2003-12-20 15:32:55 +00:00
parent 7be614a087
commit 54c8e821b8
7 changed files with 578 additions and 7 deletions

View File

@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.138 2003/11/29 22:40:53 pgsql Exp $
* $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.139 2003/12/20 15:32:55 momjian Exp $
*
* NOTES
* some of the information in this file should be moved to
@ -150,6 +150,8 @@ extern DLLIMPORT Oid MyDatabaseId;
* USE_ISO_DATES specifies ISO-compliant format
* USE_SQL_DATES specifies Oracle/Ingres-compliant format
* USE_GERMAN_DATES specifies German-style dd.mm/yyyy
* USE_ISO8601BASIC_DATES specifies ISO-8601-basic format (including
* ISO compliant but non-human-friendly intervals)
*
* DateOrder defines the field order to be assumed when reading an
* ambiguous date (anything not in YYYY-MM-DD format, with a four-digit
@ -169,6 +171,7 @@ extern DLLIMPORT Oid MyDatabaseId;
#define USE_ISO_DATES 1
#define USE_SQL_DATES 2
#define USE_GERMAN_DATES 3
#define USE_ISO8601BASIC_DATES 4
/* valid DateOrder values */
#define DATEORDER_YMD 0