pgsql: Adjust the parser to accept the typename syntax INTERVAL ...

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Adjust the parser to accept the typename syntax INTERVAL ...
Date: 2008-09-11 15:27:30
Message-ID: 20080911152730.AD6227545A3@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Adjust the parser to accept the typename syntax INTERVAL ... SECOND(n)
and the literal syntax INTERVAL 'string' ... SECOND(n), as required by the
SQL standard. Our old syntax put (n) directly after INTERVAL, which was
a mistake, but will still be accepted for backward compatibility as well
as symmetry with the TIMESTAMP cases.

Change intervaltypmodout to show it in the spec's way, too. (This could
potentially affect clients, if there are any that analyze the typmod of an
INTERVAL in any detail.)

Also fix interval input to handle 'min:sec.frac' properly; I had overlooked
this case in my previous patch.

Document the use of the interval fields qualifier, which up to now we had
never mentioned in the docs. (I think the omission was intentional because
it didn't work per spec; but it does now, or at least close enough to be
credible.)

Modified Files:
--------------
pgsql/doc/src/sgml:
datatype.sgml (r1.227 -> r1.228)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/datatype.sgml?r1=1.227&r2=1.228)
pgsql/src/backend/parser:
gram.y (r2.622 -> r2.623)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/gram.y?r1=2.622&r2=2.623)
pgsql/src/backend/utils/adt:
datetime.c (r1.191 -> r1.192)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/datetime.c?r1=1.191&r2=1.192)
timestamp.c (r1.191 -> r1.192)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/timestamp.c?r1=1.191&r2=1.192)
pgsql/src/test/regress/expected:
interval.out (r1.21 -> r1.22)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/interval.out?r1=1.21&r2=1.22)
pgsql/src/test/regress/sql:
interval.sql (r1.13 -> r1.14)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/interval.sql?r1=1.13&r2=1.14)

Browse pgsql-committers by date

  From Date Subject
Next Message User Mkz 2008-09-11 15:34:51 plproxy - plproxy: news for 2.0.7
Previous Message User Mkz 2008-09-11 15:04:41 plproxy - plproxy: Use server_encoding as remote connection encoding