Re: Bug in date arithmetic - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: Bug in date arithmetic
Date
Msg-id 4A92BC38020000250002A00C@gw.wicourts.gov
Whole thread Raw
In response to Re: Bug in date arithmetic  (Greg Stark <gsstark@mit.edu>)
Responses Re: Bug in date arithmetic  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Greg Stark <gsstark@mit.edu> wrote:
> David Fetter<david@fetter.org> wrote:
>> I'm thinking that the unknown literal here should just cause an
>> error in the case of '+'.  Same with '-', for what it's worth.
> 
> That would make a lot of people very unhappy. They expect things
> like
> 
> select date + '1 year'
> 
> to just work.
I realize I'm in a minority on this, but I would also prefer an error.
I expect things like
SELECT "date" + (INTERVAL '1' YEAR)
to just work.  This whole business of taking a perfectly explicit
character string literal and treating it as an unknown literal until
something in the surrounding context causes it to automagically
resolve to any type kinda makes my skin crawl.
I'd love to have a GUC to resolve character string literals to text
when they're not in a context which makes them part of some other
standard literal declaration.
-Kevin


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: 8.5 release timetable, again
Next
From: Robert Haas
Date:
Subject: Re: 8.5 release timetable, again