Re: MySQL search query is not executing in Postgres DB - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: MySQL search query is not executing in Postgres DB
Date
Msg-id 50B53946.1070507@gmx.net
Whole thread Raw
In response to Re: MySQL search query is not executing in Postgres DB  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On 11/25/12 7:21 PM, Robert Haas wrote:
> Sure, in theory that is true, but no other RDBMS that I know about
> feels a need to error out in that situation.  I'm skeptical of the
> contention that we're smarter than everyone else.

Well, I think in most programming languages that have typed function
prototypes,

define foo(string)

call foo(55)

is an error.  I could be convinced otherwise, but that's my current
impression.  So the principle of rejecting this is not new.

If, on the other hand, we want to align more with other RDBMS that
apparently allow this, we should look closer into by what rules they do
this.  If they use assignment casts (that is, the same rules that apply
when running INSERT, for example), we could look into using that as
well, but then we should do that all the time, and not only as a
fallback of some sort.  Because that's (a) arbitrary, and (b) causes
failures when overloaded functions are added, which shouldn't happen
(the existing cases where adding overloaded functions cause an existing
function to fail are surely warts that should be removed, not new ones
designed in).

I wonder what implicit casts would be good for if assignment casts
applied for function and operator calls.



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: PQconninfo function for libpq
Next
From: Alvaro Herrera
Date:
Subject: Re: Review: Patch to compute Max LSN of Data Pages