I want to get this result:
i|c|d
-+-+-
1|a|c
2|b|
(2 rows)
so I did this
rosa=> create table a (i int, c text);
CREATE
rosa=> create table b (i int, d text);
CREATE
rosa=> insert into a (i,c) values (1,'a');
INSERT 4653972 1
rosa=> insert into a (i,c) values (2,'b');
INSERT 4653974 1
rosa=> insert into b (i,d) values (1,'c');
INSERT 4653975 1
and then tried to select but...
rosa=> select a.i,a.c,b.d from a,b where a.i=b.i or not a.i in (select i
from b);
pqReadData() -- backend closed the channel unexpectedly.
This probably means the backend terminated abnormally before or
while processing the request.
We have lost the connection to the backend, so further processing is
impossible. Terminating.
I can achieve the result I want in two steps using a temporary table but
the backend should not die in any case. Is my SELECT correct and "correct"
SQL?
I have a 6.4 PostgreSQL built on RedHat 5.1.
Ari