BUG #5225: create table: cast necessary for constant?? - Mailing list pgsql-bugs

From Kurt wagner
Subject BUG #5225: create table: cast necessary for constant??
Date
Msg-id 200912021245.nB2CjFpb043790@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #5225: create table: cast necessary for constant??
List pgsql-bugs
The following bug has been logged online:

Bug reference:      5225
Logged by:          Kurt wagner
Email address:      kurt.wagnerextern@leoni.com
PostgreSQL version: 8.41
Operating system:   HP-UX
Description:        create table: cast necessary for constant??
Details:

During migration from Informix to Postgres I came across following issue:
create temp table temp1 as
   SELECT  firmnr,
           werknr,
           'I' as invper,
           invnum
   from .... ;

the next select on table temp1 returned the error
ERROR: failed to find conversion function from unknown to character [SQL
State=XX000]

I could find out that the column invper in the temp. table temp1 was defined
as data type "unknown". To me it is a bug because the column is filled by a
constant. So regardless if you estimate it as char, varchar, or text it is
still processable whereas "unknown" is the worst case and returns an error
as described above.

other DBs (e.g. db2, or Informix) can handle such cases correctly.

is it possible to fix it, please?

pgsql-bugs by date:

Previous
From: Craig Ringer
Date:
Subject: Re: BUG #5224: After upgrading from vista to windows 7, postgres services are missing
Next
From: "aftab"
Date:
Subject: BUG #5226: Limit operator slows down