Re: Implicit coercions need to be reined in

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Implicit coercions need to be reined in
Дата
Msg-id 1656.1018540676@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Implicit coercions need to be reined in  (Barry Lind <barry@xythos.com>)
Список 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 по дате отправления:

Предыдущее
От: Neil Conway
Дата:
Сообщение: Re: 7.3 schedule
Следующее
От: Christopher Kings-Lynne
Дата:
Сообщение: Re: RFC: Restructuring pg_aggregate