pgsql: Fix DecodeInterval to report an error for multiple occurrences of - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Fix DecodeInterval to report an error for multiple occurrences of
Date
Msg-id 20090601165511.7E44A75331E@cvs.postgresql.org
Whole thread Raw
List 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)

pgsql-committers by date:

Previous
From: bmomjian@pgfoundry.org (User Bmomjian)
Date:
Subject: pg-migrator - pg_migrator: Add windows.h include.
Next
From: bmomjian@pgfoundry.org (User Bmomjian)
Date:
Subject: pg-migrator - pg_migrator: Handle Win32 MoveFile return value, per