Re: Possible bug on insert

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Rick Gigger" <rick(at)alpinenetworking(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Possible bug on insert
Date: 2003-10-06 19:04:07
Message-ID: 429.1065467047@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Rick Gigger" <rick(at)alpinenetworking(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2003-10-06 19:29:49 Re: pg_restore takes ages
Previous Message Relaxin 2003-10-06 18:46:10 Re: PostgreSQL Beta4 Tag'd and Bundle'd ...