Interval literal not ANSI compliant

From: Ed Smith <edsmithed(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Interval literal not ANSI compliant
Date: 2004-09-01 22:29:09
Message-ID: 20040901222909.33921.qmail@web52903.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The Postgres INTERVAL literal is not compliant with
the ANSI 2003 SQL Spec. Here's the Postgres way:

# select INTERVAL '45 DAY';
interval
----------
45 days
(1 row)

The spec. says

<interval literal> ::= INTERVAL [ <sign> ] <interval
string> <interval qualifier>

<interval string> ::= <quote> <unquoted interval
string> <quote>

Note specifically that the quotes only enclose the
number, not the interval qualifier. So Postgres
interval literals should be

# select INTERVAL '45' DAY;
interval
----------
00:00:00
(1 row)

Note that Postgres accepts the ANSI form but then
interprets it completely incorrectly. IMHO this is
much worse than rejecting the ANSI form. Are there
plans to fix this? I am using 7.4.3.


_______________________________
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Anony Mous 2004-09-01 22:58:13 Re: Can't connect to Windows port + other
Previous Message Tom Lane 2004-09-01 22:25:55 Re: beta2 not finding openssl