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?