1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-29 10:41:53 +03:00

Add support for input and output of interval values formatted per ISO 8601;

specifically, we can input either the "format with designators" or the
"alternative format", and we can output the former when IntervalStyle is set
to iso_8601.

Ron Mayer
This commit is contained in:
Tom Lane
2008-11-11 02:42:33 +00:00
parent a44564b4f8
commit a4917bef0e
11 changed files with 605 additions and 34 deletions

View File

@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/nabstime.c,v 1.157 2008/11/09 00:28:35 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/nabstime.c,v 1.158 2008/11/11 02:42:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -634,6 +634,12 @@ reltimein(PG_FUNCTION_ARGS)
if (dterr == 0)
dterr = DecodeInterval(field, ftype, nf, INTERVAL_FULL_RANGE,
&dtype, tm, &fsec);
/* if those functions think it's a bad format, try ISO8601 style */
if (dterr == DTERR_BAD_FORMAT)
dterr = DecodeISO8601Interval(str,
&dtype, tm, &fsec);
if (dterr != 0)
{
if (dterr == DTERR_FIELD_OVERFLOW)