Re: Why is this allowed?

From: "Chuck McDevitt" <cmcdevitt(at)greenplum(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Gregory Stark" <stark(at)enterprisedb(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Why is this allowed?
Date: 2007-03-11 01:36:55
Message-ID: EB48EBF3B239E948AC1E3F3780CF8F8801D78433@MI8NYCMAIL02.Mi8.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ok...

Just to be clear, the ISO SQL spec says that INTERVAL '1' DAY is the
correct way to specify a one-day interval.
That's why it is surprising that PostgreSQL treats it differently, with
no error or warning.

The PostgreSQL syntax INTERVAL '1 DAY' is non-standard.

Is fixing this on the TODO list?

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Saturday, March 10, 2007 5:11 PM
To: Gregory Stark
Cc: Chuck McDevitt; pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] Why is this allowed?

Gregory Stark <stark(at)enterprisedb(dot)com> writes:
> "Chuck McDevitt" <cmcdevitt(at)greenplum(dot)com> writes:
>> Why don't we have some kind of error check for people entering things
>> like INTERVAL '1' DAY in their query, since we don't handle it.

> Because it's not an error. It just doesn't mean what you think it
means.

What it is is an incompletely implemented feature. That syntax is
required by the SQL spec, and Tom Lockhart had been making progress
towards supporting it when he got bored and left the project. Where
he left it is that the grammar accepts it but the interval input routine
isn't paying any attention to the qualifier.

I'm not eager to rip out what's there, but I don't personally feel
like making it work either...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-03-11 01:53:11 Re: Why is this allowed?
Previous Message Tom Lane 2007-03-11 01:11:06 Re: Why is this allowed?