Re: Possible bug on insert - Mailing list pgsql-general

From Tom Lane
Subject Re: Possible bug on insert
Date
Msg-id 429.1065467047@sss.pgh.pa.us
Whole thread Raw
In response to Re: Possible bug on insert  ("Rick Gigger" <rick@alpinenetworking.com>)
List pgsql-general
"Rick Gigger" <rick@alpinenetworking.com> writes:
> insert into bugtest (a) select '1' union select '1'; -- this one fails

> Is this a bug?

No.  It's unfortunate perhaps, but it's not a bug.  The UNION forces us
to make a decision about the output datatype of the UNION operation.
In your other cases the chosen datatype is integer, which can later be
cast to smallint for the insert, but in this case the chosen datatype is
text, which is not implicitly castable to smallint.

            regards, tom lane

pgsql-general by date:

Previous
From: "Rick Gigger"
Date:
Subject: Re: Possible bug on insert
Next
From: Bruce Momjian
Date:
Subject: Re: pg_restore takes ages