Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c72Lx-0000Xd-LP for pgsql-bugs@arkaria.postgresql.org; Wed, 16 Nov 2016 15:42:25 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c72Lx-0001K6-4j for pgsql-bugs@arkaria.postgresql.org; Wed, 16 Nov 2016 15:42:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c72Lw-0001K0-RK for pgsql-bugs@postgresql.org; Wed, 16 Nov 2016 15:42:24 +0000 Received: from fr1.2ndquadrant.fr ([94.23.17.124]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c72Lt-0003Ih-Lo for pgsql-bugs@postgresql.org; Wed, 16 Nov 2016 15:42:24 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by fr1.2ndquadrant.fr (Postfix) with ESMTP id 9F73F604EF; Wed, 16 Nov 2016 16:42:20 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at fr1.2ndquadrant.fr Received: from fr1.2ndquadrant.fr ([127.0.0.1]) by localhost (fr1.2ndquadrant.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6ePdv1j7BLgB; Wed, 16 Nov 2016 16:42:19 +0100 (CET) Received: from [192.168.0.3] (ath91-3-88-167-161-184.fbx.proxad.net [88.167.161.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: charles) by fr1.2ndquadrant.fr (Postfix) with ESMTPSA id 7E87E60388; Wed, 16 Nov 2016 16:42:19 +0100 (CET) Subject: Re: BUG #14426: union causes error To: abo@zetescards.be, pgsql-bugs@postgresql.org References: <20161116142514.6530.69539@wrigleys.postgresql.org> From: Vik Fearing Message-ID: <52bb75a0-2927-39f7-9a06-7503ec41d0f4@2ndquadrant.fr> Date: Wed, 16 Nov 2016 16:42:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <20161116142514.6530.69539@wrigleys.postgresql.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -4.8 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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