Skip to content

Commit 0ea4f9c

Browse files
committed
Back out:
> 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.
1 parent ced30eb commit 0ea4f9c

File tree

7 files changed

+7
-576
lines changed

7 files changed

+7
-576
lines changed

doc/src/sgml/datatype.sgml

Lines changed: 1 addition & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.138 2003/12/20 16:06:54 momjian Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.139 2003/12/21 04:34:35 momjian Exp $
33
-->
44

55
<chapter id="datatype">
@@ -1785,55 +1785,6 @@ January 8 04:05:06 1999 PST
17851785
<replaceable>p</replaceable> should be between 0 and 6, and
17861786
defaults to the precision of the input literal.
17871787
</para>
1788-
1789-
1790-
<para>
1791-
Alternatively, <type>interval</type> values can be written as
1792-
ISO 8601 time intervals, using the "Format with time-unit designators".
1793-
This format always starts with the character <literal>'P'</>, followed
1794-
by a string of values followed by single character time-unit designators.
1795-
A <literal>'T'</> separates the date and time parts of the interval.
1796-
</para>
1797-
1798-
<para>
1799-
Format: PnYnMnDTnHnMnS
1800-
</para>
1801-
<para>
1802-
In this format, <literal>'n'</> gets replaced by a number, and
1803-
<literal>Y</> represents years,
1804-
<literal>M</> (in the date part) months,
1805-
<literal>D</> months,
1806-
<literal>H</> hours,
1807-
<literal>M</> (in the time part) minutes,
1808-
and <literal>S</> seconds.
1809-
</para>
1810-
1811-
1812-
<table id="interval-example-table">
1813-
<title>Interval Example</title>
1814-
<tgroup cols="2">
1815-
<thead>
1816-
<row>
1817-
<entry>Traditional</entry>
1818-
<entry>ISO-8601 time-interval</entry>
1819-
</row>
1820-
</thead>
1821-
<tbody>
1822-
<row>
1823-
<entry>1 month</entry>
1824-
<entry>P1M</entry>
1825-
</row>
1826-
<row>
1827-
<entry>1 hour 30 minutes</entry>
1828-
<entry>PT1H30M</entry>
1829-
</row>
1830-
<row>
1831-
<entry>2 years 10 months 15 days 10 hours 30 minutes 20 seconds</entry>
1832-
<entry>P2Y10M15DT10H30M20S</entry>
1833-
</row>
1834-
</tbody>
1835-
</tgroup>
1836-
</table>
18371788
</sect3>
18381789

18391790
<sect3>
@@ -1990,11 +1941,6 @@ January 8 04:05:06 1999 PST
19901941
<entry>regional style</entry>
19911942
<entry>17.12.1997 07:37:16.00 PST</entry>
19921943
</row>
1993-
<row>
1994-
<entry>ISO8601basic</entry>
1995-
<entry>ISO 8601 basic format</entry>
1996-
<entry>19971217T073716-08</entry>
1997-
</row>
19981944
</tbody>
19991945
</tgroup>
20001946
</table>
@@ -2051,11 +1997,6 @@ January 8 04:05:06 1999 PST
20511997
</programlisting>
20521998
</para>
20531999

2054-
<para>
2055-
If the <varname>datestyle</> is set to iso8601basic, the interval
2056-
output is a ISO-8601 time interval with time-unit designator (like P1Y6M or PT23H59M59S).
2057-
</para>
2058-
20592000
<para>
20602001
The date/time styles can be selected by the user using the
20612002
<command>SET datestyle</command> command, the

src/backend/commands/variable.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/commands/variable.c,v 1.91 2003/12/20 15:32:54 momjian Exp $
12+
* $PostgreSQL: pgsql/src/backend/commands/variable.c,v 1.92 2003/12/21 04:34:35 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -82,12 +82,7 @@ assign_datestyle(const char *value, bool doit, bool interactive)
8282

8383
/* Ugh. Somebody ought to write a table driven version -- mjl */
8484

85-
if (strcasecmp(tok, "ISO8601BASIC") == 0)
86-
{
87-
newDateStyle = USE_ISO8601BASIC_DATES;
88-
scnt++;
89-
}
90-
else if (strcasecmp(tok, "ISO") == 0)
85+
if (strcasecmp(tok, "ISO") == 0)
9186
{
9287
newDateStyle = USE_ISO_DATES;
9388
scnt++;
@@ -203,9 +198,6 @@ assign_datestyle(const char *value, bool doit, bool interactive)
203198
case USE_ISO_DATES:
204199
strcpy(result, "ISO");
205200
break;
206-
case USE_ISO8601BASIC_DATES:
207-
strcpy(result, "ISO8601BASIC");
208-
break;
209201
case USE_SQL_DATES:
210202
strcpy(result, "SQL");
211203
break;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy