Port Bug Report: select of array columns

From: Unprivileged user <nobody>
To: pgsql-ports(at)postgresql(dot)org
Subject: Port Bug Report: select of array columns
Date: 1999-02-11 13:45:45
Message-ID: 199902111345.IAA03755@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-ports


============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================

Your name : Michael Tomuschat
Your email address : michael(at)knoto(dot)tuebingen(dot)com

Category : runtime: back-end: SQL
Severity : serious

Summary: select of array columns

System Configuration
--------------------
Operating System : Linux 2.0.32

PostgreSQL version : 6.4

Compiler used : gcc

Hardware:
---------
Pentium 64 MB

Versions of other tools:
------------------------

--------------------------------------------------------------------------

Problem Description:
--------------------
create table test ( art_id int, fil_arr int[]);
insert into test values ( 1, '{1, 2, 3, 4}');
insert into test values ( 2, '{2, 3, 4, 5}');
insert into test values ( 3, '{3, 4, 5, 6}');
michael=> select * from test;
art_id|fil_arr
------+---------
1|{1,2,3,4}
2|{2,3,4,5}
3|{3,4,5,6}
(3 rows) -- is o.k.

michael=> select * from test where 1 = test.fil_arr[1];
art_id|fil_arr
------+---------
1|{1,2,3,4}
(1 row) -- shouldn't the array - index start with 0?

michael=> select test.fil_arr[1:2] from test;
fil_arr
-------
{1,2}
{2,3}
{3,4}
(3 rows) -- is o.k.

michael=> select fil_arr[1] from test; -- should be possible, too
ERROR: type name lookup of fil_arr failed

michael=> select * from test where 1 IN (test.fil_arr[1]); -- seems not to work in 'IN' statements
ERROR: parser: parse error at or near "."

AND: ( but not a bug): There seems to be no possibility to
check, if there is an value in an array
select * from test where 3 IN ( test.fil_arr[1:3]);

--------------------------------------------------------------------------

Test Case:
----------

--------------------------------------------------------------------------

Solution:
---------

--------------------------------------------------------------------------

Responses

Browse pgsql-ports by date

  From Date Subject
Next Message Thomas G. Lockhart 1999-02-11 14:50:04 Re: [PORTS] Port Bug Report: select of array columns
Previous Message Unprivileged user 1999-02-11 09:04:26 Port Bug Report: Memory fault core dump when invoking initdb