Re: BUG #5225: create table: cast necessary for constant??
| От | Craig Ringer |
|---|---|
| Тема | Re: BUG #5225: create table: cast necessary for constant?? |
| Дата | |
| Msg-id | 4B169A00.6010504@postnewspapers.com.au обсуждение исходный текст |
| Ответ на | Re: BUG #5225: create table: cast necessary for constant?? (Tom Lane <tgl@sss.pgh.pa.us>) |
| Ответы |
Re: BUG #5225: create table: cast necessary for
constant??
|
| Список | pgsql-bugs |
On 3/12/2009 12:35 AM, Tom Lane wrote:
> "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.
It's usually neatest to do this by just explicitly identifying the
intended type in the first place, eg:
SELECT firmnr,
werknr,
TEXT 'I' as invper,
invnum
from .... ;
... which, IIRC, is the standard way to do it. I don't have a copy to
check against to be sure.
Personally, I like the fact that Pg errs on the side of caution here
rather than guessing what you want.
--
Craig Ringer
В списке pgsql-bugs по дате отправления: