except on nulls? - Mailing list pgsql-sql

From Daniel Kalchev
Subject except on nulls?
Date
Msg-id 200010270602.JAA16927@dcave.digsys.bg
Whole thread Raw
Responses Re: except on nulls?
Re: except on nulls?
List pgsql-sql
I had the following weird experience. Hopefuly iy's my ignorance on the matter 
(but I sort of think this worked before...)

On PostgreSQL 7.0.2, I have an database with two tables, holding different 
versions of the data set (some rows missing in one of the tables). Example is:

CREATE TABLE "test1" (       "f1" text,       "f2" date,       "f3" "_text",       "f4" int4,       "f5" character
varying(16)
);

Then table test2 with the same definition.

SELECT f1 FROM test2 EXCEPT SELECT f1 from test1;

produced empty result, although test2 contained few more rows.

Closer examination showed that both tables contained an 'null' row, with all 
fields null.

After removing both rows, the query would return the proper results.

Another query,

SELECT * from test2 EXCEPT SELECT * from test1;

failed too, giving the following error:

ERROR:  Unable to identify an operator '<>' for types '_text' and '_text'       You will have to retype this query
usingan explicit cast
 

Any idea why this is happening?

Daniel



pgsql-sql by date:

Previous
From: Michael Teter
Date:
Subject: renaming columns... danger?
Next
From: Tom Lane
Date:
Subject: Re: HELP! ... pg_locale ???