![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
The following bug has been logged online: Bug reference: 1517 Logged by: Roy Badami Email address: roy (AT) gnomon (DOT) org.uk PostgreSQL version: 8.0.1 Operating system: Solaris 9 Description: SQL interval syntax is accepted by the parser, but the interpretation is bogus Details: The parser accepts SQL interval syntax, but then silently ignores it, treating it as a zero interval. radius=# select date '2005-01-01' + interval '1' month; ?column? --------------------- 2005-01-01 00:00:00 (1 row) radius=# select timestamp '2005-01-1 00:00:00' + interval '1' minute; ?column? --------------------- 2005-01-01 00:00:00 (1 row) |
#2
| |||
| |||
|
|
Well, that certainly belongs in the 'bizarre' category. It should not accept that syntax. It should require the 'month' or 'minute' to be in single quotes. |
#3
| |||
| |||
|
#4
| |||
| |||
|
#5
| |||
| |||
|
|
Tom> No, it shouldn't; read the SQL spec. AFAICS the syntax Tom> select interval '1' month is perfectly spec-compliant. The Tom> variant select interval '1 month' is *not* per-spec, it is a Tom> Postgres-ism. That is my understanding, though I don't have a copy of the spec (my reference is Date & Darwen's "A guide to the SQL standard") |
|
However, it may be better if the PostgreSQL parser rejected the syntax. The current behaviour would seem to be a smoking gun for people porting ANSI-compliant SQL applications (assuming such things exist to PostgreSQL. |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
All the documented interval functionality works fine. The undocumented support for ANSI SQL interval data types and litereals doesn't :-/ |
#8
| |||
| |||
|
#9
| |||
| |||
|
|
ie do you accept interval '1 day 1 hour' day to second |
#10
| |||
| |||
|
|
"Tom" == Tom Lane <tgl (AT) sss (DOT) pgh.pa.us> writes: ie do you accept interval '1 day 1 hour' day to second |
![]() |
| Thread Tools | |
| Display Modes | |
| |