diff options
author | Bruce Momjian <bruce@momjian.us> | 2006-04-25 00:01:44 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2006-04-25 00:01:44 +0000 |
commit | c880f9aeb2444d70a42871999498ece0b2d90cba (patch) | |
tree | 60fcdcf9e8c5cf4ae005da4c18fd9f668aedefe2 /src/backend/tcop/postgres.c | |
parent | 02b59c6ebde55888b9c21257d8d311f974715f49 (diff) | |
download | postgresql-c880f9aeb2444d70a42871999498ece0b2d90cba.tar.gz postgresql-c880f9aeb2444d70a42871999498ece0b2d90cba.zip |
Update SQL-standard INTERVAL item:
o Support ISO INTERVAL syntax if units cannot be determined from
the string, and are supplied after the string
The SQL standard states that the units after the string specify
the units of the string, e.g. INTERVAL '2' MINUTE should
return '00:02:00'. The current behavior has the units
restrict the interval value to the specified unit or unit range,
INTERVAL '70' SECOND returns '00:00:10'.
For syntax that isn't uniquely ISO or PG syntax, like '1' or
'1:30', treat as ISO if there is a range specification clause,
and as PG if there no clause is present, e.g. interpret
'1:30' MINUTE TO SECOND as '1 minute 30 seconds', and
interpret '1:30' as '1 hour, 30 minutes'.
This makes common cases like SELECT INTERVAL '1' MONTH
SQL-standard results. The SQL standard supports a limited
number of unit combinations and doesn't support unit names
in the string. The PostgreSQL syntax is more flexible in
the range of units supported, e.g. PostgreSQL supports
'1 year 1 hour', while the SQL standard does not.
Diffstat (limited to 'src/backend/tcop/postgres.c')
0 files changed, 0 insertions, 0 deletions