Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:
> On Sat, 8 Mar 2003, Jean-Christian Imbeault wrote:
>> # select submit from invoices where submit <= 2003-03-09;
> The right side isn't a date. It's an integral expression that evaluates
> to 1991 I believe.
Yeah. And IMHO this should be rejected entirely; there is no "date <= int4"
operator. If you dig into it you find that the parser is actually
interpreting the query as WHERE submit::text <= '1991'::text.
Apparently "text <= text" is the closest match it can find.
This is just another example of why allowing implicit coercions from
everything to text is a Bad Idea ...
regards, tom lane