Bug #954: select distinct array - Mailing list pgsql-bugs

From pgsql-bugs@postgresql.org
Subject Bug #954: select distinct array
Date
Msg-id 20030423114549.66AF8475F1B@postgresql.org
Whole thread Raw
Responses Re: Bug #954: select distinct array  (Joe Conway <mail@joeconway.com>)
List pgsql-bugs
A.Bhuvaneswaran (bhuvansql@myrealbox.com) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
select distinct array

Long Description
Hi,

Are we unable to select distinct values from an array? If so, how can we select distinct values from an array without
usingsubscripts? Googling didn't help. 

regards,
bhuvaneswaran

Sample Code
test_pg=# SELECT version();
                           version
-------------------------------------------------------------
 PostgreSQL 7.3.2 on i686-pc-linux-gnu, compiled by GCC 2.96
(1 row)

test_pg=# CREATE TABLE array_test(id int[]);
CREATE TABLE
test_pg=# INSERT INTO array_test VALUES ('{1,3}');
INSERT 4338949 1
test_pg=# INSERT INTO array_test VALUES ('{1,4}');
INSERT 4338950 1
test_pg=# INSERT INTO array_test VALUES ('{1,4}');
INSERT 4338951 1
test_pg=# SELECT distinct id from array_test ;
ERROR:  Unable to identify an ordering operator '<' for type 'integer[]'
        Use an explicit ordering operator or modify the query
test_pg=#


No file was uploaded with this report

pgsql-bugs by date:

Previous
From: "CN"
Date:
Subject: UNION Types Mismatch
Next
From: Tom Lane
Date:
Subject: Re: UNION Types Mismatch