Re: Why is this allowed? - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: Why is this allowed?
Date
Msg-id 87odn0zjnh.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: Why is this allowed?  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
"Gregory Stark" <stark@enterprisedb.com> writes:

> "Chuck McDevitt" <cmcdevitt@greenplum.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.
>
> You've requested an interval measured in days and supplied '1' as the value
> which is read as a single second. 

Actually sorry, that's true but it seems it's a bug. The comments even use the
example INTERVAL '1' YEAR which one imagines the author didn't intend to be
parsed as a 1 second interval measured in years.

Looking more at it now. There are a couple different grammar productions that
look like they might be relevant, I'm not sure which is getting used here.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Gregory Stark
Date:
Subject: Re: Why is this allowed?
Next
From: Tom Lane
Date:
Subject: Re: Why is this allowed?