From: Vik Fearing <vik@2ndquadrant.fr>
To: abo@zetescards.be
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #14426: union causes error
Date: Wed, 16 Nov 2016 16:42:18 +0100
Message-ID: <52bb75a0-2927-39f7-9a06-7503ec41d0f4@2ndquadrant.fr> (raw)
In-Reply-To: <20161116142514.6530.69539@wrigleys.postgresql.org>
References: <20161116142514.6530.69539@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
On 11/16/2016 03:25 PM, abo@zetescards.be wrote:
> The following bug has been logged on the website:
>
> Bug reference: 14426
> Logged by: Alain Bourgeois
> Email address: abo@zetescards.be
> PostgreSQL version: 9.6.1
> Operating system: Linux
> Description:
>
> select null union select null union select 1
>
> causes an error.
First of all, it is standard practice to say what the error is.
This is not a bug, but a known limitation. In your first query, your
column is of type "unknown", but when you union it with another unknown
type, it gets turned into text. Unioning text with integer is what is
giving you your error.
The solution is to make sure you type your data, at least in the first
query.
--
Vik Fearing +33 6 46 75 15 36
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: vik@2ndquadrant.fr, abo@zetescards.be
Subject: Re: BUG #14426: union causes error
In-Reply-To: <52bb75a0-2927-39f7-9a06-7503ec41d0f4@2ndquadrant.fr>
References: <20161116142514.6530.69539@wrigleys.postgresql.org> <52bb75a0-2927-39f7-9a06-7503ec41d0f4@2ndquadrant.fr>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox