Re: Implicit coercions need to be reined in

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Barry Lind <barry(at)xythos(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Implicit coercions need to be reined in
Date: 2002-04-11 15:57:56
Message-ID: 1656.1018540676@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Barry Lind <barry(at)xythos(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2002-04-11 16:00:03 Re: 7.3 schedule
Previous Message Neil Conway 2002-04-11 15:54:34 Re: 7.3 schedule