BUG: Each UNION | EXCEPT | INTERSECT query must have the same number of columns. - Mailing list pgsql-bugs

From Jacek Konieczny
Subject BUG: Each UNION | EXCEPT | INTERSECT query must have the same number of columns.
Date
Msg-id 20010327193938.A6497@nic.nigdzie
Whole thread Raw
Responses Re: BUG: Each UNION | EXCEPT | INTERSECT query must have the same number of columns.
List pgsql-bugs
Your name               : Jacek Konieczny
Your email address      : jajcus@bnet.pl


System Configuration
---------------------
  Architecture (example: Intel Pentium)         : AMD K6-II 3DNow

  Operating System (example: Linux 2.0.26 ELF)  : Linux 2.4.2 ELF  (PLD Distribution)

  PostgreSQL version (example: PostgreSQL-7.0):   PostgreSQL-7.0.3

  Compiler used (example:  gcc 2.8.0)           : probably 2.95.3


Please enter a FULL description of your problem:
------------------------------------------------
When using query with EXCEPT clause in INSERT command sometime
false "ERROR:  Each UNION | EXCEPT | INTERSECT query must have the same
number of columns." is generated, and the command fails.
Probably default values are added to the first query before it
is compared to the second one.


Please describe a way to repeat the problem.   Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------
CREATE TABLE tb1 ( a CHARACTER(10) DEFAULT 'abc', b CHARACTER(10));
CREATE TABLE tb2 ( a CHARACTER(10), b CHARACTER(10));
INSERT INTO tb1(b) SELECT b FROM tb2 EXCEPT SELECT b FROM tb1;

If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------
I would have to check the source code...

pgsql-bugs by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: [PATCHES] Error in the date field (with NULL value...).Thanks!
Next
From: "Fernando Schutz"
Date:
Subject: I can't initialize