Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-ports by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group