Interval literal not ANSI compliant - Mailing list pgsql-general

From Ed Smith
Subject Interval literal not ANSI compliant
Date
Msg-id 20040901222909.33921.qmail@web52903.mail.yahoo.com
Whole thread Raw
Responses Re: Interval literal not ANSI compliant  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: beta2 not finding openssl
Next
From: "Anony Mous"
Date:
Subject: Re: Can't connect to Windows port + other