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

From Merlin Moncure
Subject Re: MySQL search query is not executing in Postgres DB
Date
Msg-id CAHyXU0wgvJ0ziHwRer2cb4DR1-Ha_TErFm0EgGpy_tCXAidwBw@mail.gmail.com
Whole thread Raw
In response to Re: MySQL search query is not executing in Postgres DB  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: MySQL search query is not executing in Postgres DB
List pgsql-hackers
On Tue, Nov 27, 2012 at 4:09 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
> On 11/27/12 12:07 PM, Merlin Moncure wrote:
>> Speaking of polymorphism, why not just implement lpad()'s first
>> argument as 'anyelement'?
>
> One of the arguments made here was that lpad(not-text) *should* fail.

Well, sure.  My point is: why do we need to break the casting
machinery when we can simply tweak a few of the standard functions on
portability grounds?

Robert's case on lpad() has merit in the sense it has unambiguous
meaning regardless of input type; polymorphic input types were
designed to solve *exactly* that problem.  SQL portability is a
secondary but also important argument.

That said, md5() surely needs some type of cast or interpretation of
non-text types.  ditto to_timestamp(), etc.  So messing around with
the casting rules is surely the wrong answer. I think if you relaxed
the function sigs of a few functions on this page
(http://www.postgresql.org/docs/9.2/interactive/functions-string.html),
most reported problems would go away.

One thing that worries me is introducing ambiguous cases where
previously there weren't any though.

merlin



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Bugs in CREATE/DROP INDEX CONCURRENTLY
Next
From: Jeff Davis
Date:
Subject: Re: MySQL search query is not executing in Postgres DB