RE: [SQL] Is this BUG or FEATURE? - Mailing list pgsql-sql

From Taral
Subject RE: [SQL] Is this BUG or FEATURE?
Date
Msg-id 000001bdf9f5$cccafa00$3b291f0a@taral
Whole thread Raw
In response to Is this BUG or FEATURE?  (Vladimir Litovka <pgsqll@barnet.kharkov.ua>)
Responses RE: [SQL] Is this BUG or FEATURE?
List pgsql-sql
> create table AAA (anum int2, aname char(16), ata int4 default 0);
> insert into AAA values (0, '0');
> insert into AAA values (1, '1');
> -- Note: ata hasn't initialized!

Yes it has. ata = 0 in both because you set a default.

> test=> select * from aaa, bbb where bnum = ata;
> NOTICE:  ExecInitMergeJoin: left and right sortop's are unequal!
> anum|           aname|ata|bnum|           bname
> ----+----------------+---+----+----------------
>    0|0               |  0|   0|0
>    1|1               |  0|   0|0
> (2 rows)

You asked for all cases where bnum = ata. I assume select * from aaa,bbb;
would have returned:

anum|           aname|ata|bnum|           bname
----+----------------+---+----+----------------
   0|0               |  0|   0|0
   0|0               |  0|   1|1
   1|1               |  0|   0|0
   1|1               |  0|   1|1

Now filter for bnum=ata and you get two rows.

Am I wrong here?

Taral


pgsql-sql by date:

Previous
From: Vladimir Litovka
Date:
Subject: Is this BUG or FEATURE?
Next
From: Vladimir Litovka
Date:
Subject: RE: [SQL] Is this BUG or FEATURE?