Re: Implicit coercions need to be reined in - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Implicit coercions need to be reined in
Date
Msg-id 1656.1018540676@sss.pgh.pa.us
Whole thread Raw
In response to Re: Implicit coercions need to be reined in  (Barry Lind <barry@xythos.com>)
List pgsql-hackers
Barry Lind <barry@xythos.com> writes:
> OK.  My mistake.  In looking at the regression failures in your post, I 
> thought I saw errors being reported of this type.  My bad.

Well, although that particular case isn't a problem, I am sure that this
change will break some existing applications --- the question is how
many, and do we feel that they're all poorly coded?

I suspect that the main thing that will cause issues is removal of
implicit coercions to text.  For example, in 7.2 and before you can do

test72=# select 'At the tone, the time will be ' || now();                         ?column?
-------------------------------------------------------------At the tone, the time will be 2002-04-11
11:49:27.309181-04
(1 row)

since there is an implicit timestamp->text coercion; or in a less
plausible example,

test72=# select 123 || (33.0/7.0);     ?column?
---------------------1234.71428571428571
(1 row)

With my proposed changes, both of these examples will require explicit
casts.  The latter case might not bother people but I'm sure that
someone out there is using code much like the former case.

Since I didn't see an immediate batch of squawks, I think I will go
ahead and commit what I have; we can always revisit the implicit-allowed
flag settings later.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Neil Conway
Date:
Subject: Re: 7.3 schedule
Next
From: Christopher Kings-Lynne
Date:
Subject: Re: RFC: Restructuring pg_aggregate