Skip site navigation (1) Skip section navigation (2)

Re: BUG #1517: SQL interval syntax is accepted by the parser,

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Roy Badami <roy(at)gnomon(dot)org(dot)uk>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1517: SQL interval syntax is accepted by the parser,
Date: 2005-03-23 23:03:03
Message-ID: 15385.1111618983@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Roy Badami <roy(at)gnomon(dot)org(dot)uk> writes:
>     Roy> The 'constraint' (interval type descriptor or whatever it's
>     Roy> really called) is mandatory in standard SQL,

True.  (<interval qualifier> is what SQL99 calls it.)

> I have no objection to allowing things like
>    '1 hour 10 minutes' DAY TO SECOND
> but I'm just wondering whether the hybrid syntax is an unnecessary
> complication.

In the context of interval literals it's probably unnecessary, but
that's not the only thing to worry about.  In particular we have to
consider the behavior of the input and output routines for cases like
COPY.  I think it would be really bad to reject '1 hour 10 minutes' as
data input into an interval field just because it has an ISO qualifier.
Also, I would personally prefer to see the output from an interval field
remain in the Postgres format, precisely because the ISO format is
ambiguous without knowledge of the qualifier.  (Possibly we should
create a DateStyle-like GUC to determine that, but so far no one's
requested one.)

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2005-03-23 23:04:52
Subject: Re: BUG #1517: SQL interval syntax is accepted by the parser,
Previous:From: Roy BadamiDate: 2005-03-23 22:56:44
Subject: Re: BUG #1518: Conversions to (undocumented) SQL year-month

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group