| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | "D(dot)J(dot) Kniep" <dick(at)kniep(dot)nl> |
| Cc: | pgsql-bugs(at)postgresql(dot)org |
| Subject: | Re: BUG #1682: subselect generates multiple rows |
| Date: | 2005-05-27 14:37:05 |
| Message-ID: | 14654.1117204625@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
"D.J. Kniep" <dick(at)kniep(dot)nl> writes:
> query:
> select * from table1 t1 where t1.id in (select t2.id from view2 t2 where
> extra1 = 'a1')
> produces:
> id content
> 1 John Doe
> 1 John Doe
> 2 Peter Gabriel
Not for me ---
regression=# create table table1(id int, context text);
CREATE TABLE
regression=# create table view2(id int, extra1 text, extra2 text);
CREATE TABLE
regression=# insert into table1 values(1,'John Doe');
INSERT 156512 1
regression=# insert into table1 values(2,'Peter Gabriel');
INSERT 156513 1
regression=# insert into view2 values(1,'a1','b1');
INSERT 156514 1
regression=# insert into view2 values(1,'a1','b1');
INSERT 156515 1
regression=# insert into view2 values(2,'a1','b3');
INSERT 156516 1
regression=# insert into view2 values(3,'a1','b5');
INSERT 156517 1
regression=# select * from table1 t1 where t1.id in (select t2.id from view2 t2
where extra1 = 'a1');
id | context
----+---------------
1 | John Doe
2 | Peter Gabriel
(2 rows)
We'll need a more reproducible test case.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Magnus Hagander | 2005-05-27 14:44:14 | Re: Ordinal 968 could not be located in the dynamic link library LIBEAY32.dll |
| Previous Message | fremaux | 2005-05-27 14:36:43 | BUG #1684: ERROR: Relation 17065 does not exist |