dbTalk Databases Forums  

[BUGS] BUG #2820: "select" faling with "distinct" clause on a subquery

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #2820: "select" faling with "distinct" clause on a subquery in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
trinchero
 
Posts: n/a

Default [BUGS] BUG #2820: "select" faling with "distinct" clause on a subquery - 12-10-2006 , 01:53 PM







The following bug has been logged online:

Bug reference: 2820
Logged by: trinchero
Email address: trinchero (AT) gmail (DOT) com
PostgreSQL version: 8.2
Operating system: Windows XP
Description: "select" faling with "distinct" clause on a subquery
Details:

To reproduce:

1. create tables:

CREATE TABLE u_listino
(
u_listino_id numeric(10) NOT NULL,
u_tipolis_id numeric(10) NOT NULL
)
WITH OIDS;

CREATE TABLE u_tipolis
(
u_tipolis_id numeric(10) NOT NULL
)
WITH OIDS;

2. run the query:

SELECT U_Listino.U_LISTINO_ID FROM U_Listino
WHERE U_Listino.U_TIPOLIS_ID IN (SELECT DISTINCT U_TipoLis.U_TIPOLIS_ID
FROM U_TipoLis);

This give error:
could not find pathkey item to sort
sql state: XX000

Problem seen in a java application, and replicated using pg admin 3
(distributed with PostgresSQL 8.2)

If the same query is run without the DISTINCT, it gives no error.

Best regars.

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #2820: "select" faling with "distinct" clause on a subquery - 12-10-2006 , 02:24 PM






"trinchero" <trinchero (AT) gmail (DOT) com> writes:
Quote:
SELECT U_Listino.U_LISTINO_ID FROM U_Listino
WHERE U_Listino.U_TIPOLIS_ID IN (SELECT DISTINCT U_TipoLis.U_TIPOLIS_ID
FROM U_TipoLis);

This give error:
could not find pathkey item to sort
This has already been reported and fixed, but thanks for letting us know!

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.