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

2009-12-03 Thread Kevin Grittner
Tom Lane t...@sss.pgh.pa.us wrote: Sorry about that --- I had confused this case with that of a bare NULL literal, which Postgres treats the same as an unadorned string literal for type determination purposes. You're right that the spec treats them differently. This is feasible for the

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

2009-12-03 Thread Kevin Grittner
Wagner, Kurt kurt.wagnerext...@leoni.com wrote: when writing a character constant elsewhere then at first it is interpreted as character constant - right? then it is casted to the desired type No. It was confusing for me, too; but the PostgreSQL behavior is to treat what the standard

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

2009-12-03 Thread Kevin Grittner
Kevin Grittner kevin.gritt...@wicourts.gov wrote: There is an understandable tendency of those who work deep in the guts of the PostgreSQL software, making all this custom type code work, I mangled that sentence worse than usual. The tendency is to see the PostgreSQL behavior as natural

[BUGS] BUG #5225: create table: cast necessary for constant??

2009-12-02 Thread Kurt wagner
The following bug has been logged online: Bug reference: 5225 Logged by: Kurt wagner Email address: kurt.wagnerext...@leoni.com PostgreSQL version: 8.41 Operating system: HP-UX Description:create table: cast necessary for constant?? Details: During migration from

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

2009-12-02 Thread Tom Lane
Kurt wagner kurt.wagnerext...@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

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

2009-12-02 Thread Craig Ringer
On 3/12/2009 12:35 AM, Tom Lane wrote: Kurt wagnerkurt.wagnerext...@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

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

2009-12-02 Thread Kevin Grittner
Craig Ringer cr...@postnewspapers.com.au wrote: On 3/12/2009 12:35 AM, Tom Lane wrote: 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,

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

2009-12-02 Thread Tom Lane
Kevin Grittner kevin.gritt...@wicourts.gov writes: Quoting from section 5.3 of WG3:HBA-003 H2-2003-305 August, 2003 (ISO-ANSI Working Draft) Foundation (SQL/Foundation): | 13) The declared type of a character string literal is | fixed-length character string. Treating an otherwise

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

2009-12-02 Thread Wagner, Kurt
, Kurt; pgsql-bugs@postgresql.org Subject: Re: [BUGS] BUG #5225: create table: cast necessary for constant?? Kevin Grittner kevin.gritt...@wicourts.gov writes: Quoting from section 5.3 of WG3:HBA-003 H2-2003-305 August, 2003 (ISO-ANSI Working Draft) Foundation (SQL/Foundation): | 13