Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VTv8O-00019S-GO for pgsql-bugs@arkaria.postgresql.org; Wed, 09 Oct 2013 14:53:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VTv8N-00061V-SQ for pgsql-bugs@arkaria.postgresql.org; Wed, 09 Oct 2013 14:53:07 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VTt3g-00061I-AR for pgsql-bugs@postgresql.org; Wed, 09 Oct 2013 12:40:08 +0000 Received: from mahout.postgresql.org ([2001:4800:7903:4::123]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VTt3c-0000wq-Ne for pgsql-bugs@postgresql.org; Wed, 09 Oct 2013 12:40:07 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by mahout.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VTt3b-0007t2-SJ for pgsql-bugs@postgresql.org; Wed, 09 Oct 2013 12:40:04 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.80) (envelope-from ) id 1VTt3W-000456-Ca for pgsql-bugs@postgresql.org; Wed, 09 Oct 2013 12:39:58 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: BUG #8513: Error recognizing data type in union To: pgsql-bugs@postgresql.org From: tommi.korhonen@thl.fi Message-Id: Date: Wed, 09 Oct 2013 12:39:58 +0000 X-Pg-Spam-Score: -0.2 (/) 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 The following bug has been logged on the website: Bug reference: 8513 Logged by: Tommi Korhonen Email address: tommi.korhonen@thl.fi PostgreSQL version: 8.4.17 Operating system: Redhat Linux Description: Example: create table t1(a integer); create table t2(b integer); create table t3(c integer); select null from t1 union all select null from t2 union all select c from t3; produces an error ERROR: UNION types text and integer cannot be matched LINE 5: select c from t3; but select null from t2 union all select c from t3; works correctly. So it seems that if there are more than one nulls before field c in union PostreSQL thinks merged field's data type is text. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs