Re: BUG #5225: create table: cast necessary for constant??

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #5225: create table: cast necessary for constant??
Дата
Msg-id 14532.1259771701@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #5225: create table: cast necessary for constant??  ("Kurt wagner" <kurt.wagnerextern@leoni.com>)
Ответы Re: BUG #5225: create table: cast necessary for constant??  (Craig Ringer <craig@postnewspapers.com.au>)
Список pgsql-bugs
"Kurt wagner" <kurt.wagnerextern@leoni.com> writes:
> During migration from Informix to Postgres I came across following issue:
> create temp table temp1 as
>    SELECT  firmnr,
>            werknr,
>            'I' as invper,
>            invnum
>    from .... ;

You really ought to cast the 'I' to some specific type.  The above code
is illegal per SQL standard.  You can get away with it in certain
contexts in Postgres, but when you are creating a table or view and
don't know exactly what might be done with the column, it's much better
to ensure it's of the intended type.  We aren't going to make it default
to text or whatever because it's not always clear that that's what's
intended --- consider

    '1.2' as invper,
    '2009-11-23' as invper,

Most likely text was not what the writer had in mind in such cases.

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Sriram Gopalan
Дата:
Сообщение: Re: BUG #5224: After upgrading from vista to windows 7, postgres services are missing
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: BUG #5226: Limit operator slows down