pgsql: Fix DecodeInterval to report an error for multiple occurrences of

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix DecodeInterval to report an error for multiple occurrences of
Date: 2009-06-01 16:55:11
Message-ID: 20090601165511.7E44A75331E@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Fix DecodeInterval to report an error for multiple occurrences of DAY, WEEK,
YEAR, DECADE, CENTURY, or MILLENIUM fields, just as it always has done for
other types of fields. The previous behavior seems to have been a hack to
avoid defining bit-positions for all these field types in DTK_M() masks,
rather than something that was really considered to be desired behavior.
But there is room in the masks for these, and we really need to tighten up
at least the behavior of DAY and YEAR fields to avoid unexpected behavior
associated with the 8.4 changes to interpret ambiguous fields based on the
interval qualifier (typmod) value. Per my example and proposed patch.

Modified Files:
--------------
pgsql/src/backend/utils/adt:
datetime.c (r1.205 -> r1.206)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/datetime.c?r1=1.205&r2=1.206)
pgsql/src/include/utils:
datetime.h (r1.73 -> r1.74)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/datetime.h?r1=1.73&r2=1.74)

Browse pgsql-committers by date

  From Date Subject
Next Message User Bmomjian 2009-06-01 17:48:46 pg-migrator - pg_migrator: Handle Win32 MoveFile return value, per
Previous Message User Bmomjian 2009-06-01 14:36:27 pg-migrator - pg_migrator: Add windows.h include.