Stephan Szabo <sszabo@megazone.bigpanda.com> writes:
> Technically speaking, I believe the queries are simply invalid without the
> presence of casts from the spec's standpoint.
Right. The reason PG doesn't error is that we have an implicit cast
from integer to text. I've opined before that we should mark most
cross-type-category casts as explicit-only ... they are just too prone
to give unexpected answers, as in this case.
It's interesting that Oracle seems to be converting text to integer
instead of vice versa. Or maybe they have some truly bizarre string
comparison operation that ignores leading '0'? Whatever they are
doing, there's no support for it in the spec.
regards, tom lane