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