X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 64E9DD9891 for ; Wed, 19 Oct 2005 00:09:52 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 37122-06 for ; Wed, 19 Oct 2005 03:09:50 +0000 (GMT) Received: from web35201.mail.mud.yahoo.com (web35201.mail.mud.yahoo.com [66.163.179.80]) by svr1.postgresql.org (Postfix) with SMTP id 8FE8ED7158 for ; Wed, 19 Oct 2005 00:09:49 -0300 (ADT) Received: (qmail 80711 invoked by uid 60001); 19 Oct 2005 03:09:48 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=W+jjFAmZF6f/Nyq+iJOi4qlN2uOqskk8tcbJ/lxyicF5zd98iykBO5PbIb8FwryK2GcmXTBt6H3Sgl2KUHkht7G6WqQ/WMwDA4aUNEUfzW3mGwQ7mxzQDPNvjJlAPogdS6NbDBPSGm2jmvcKgzIFaYL/dppUVkqth4Ucq25jkcw= ; Message-ID: <20051019030948.80709.qmail@web35201.mail.mud.yahoo.com> Received: from [70.104.144.58] by web35201.mail.mud.yahoo.com via HTTP; Tue, 18 Oct 2005 20:09:48 PDT Date: Tue, 18 Oct 2005 20:09:48 -0700 (PDT) From: Matthew Peter Subject: Re: problems with array To: paperinik 100 , pgsql-sql@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.368 required=5 tests=[AWL=-0.213, DNS_FROM_RFC_ABUSE=0.374, UPPERCASE_25_50=0.207] X-Spam-Level: X-Archive-Number: 200510/207 X-Sequence-Number: 23060 Not sure if you got this figured out but I think SELECT * from tb_cat WHERE id IN (SELECT array_to_string(cat,',') as cat FROM tb_array WHERE id=1); is what your looking for? --- paperinik 100 wrote: > PostgreSQL is 7.4.7. > > My first table > CREATE TABLE tb_cat ( > id INTEGER, > desc text > ); > INSERT INTO tb_cat VALUES (10, 'cat10'); > INSERT INTO tb_cat VALUES (20, 'cat20'); > INSERT INTO tb_cat VALUES (30, 'cat30'); > > My second table > CREATE TABLE tb_array( > id INTEGER, > cat INTEGER[] > ); > INSERT INTO tb_array VALUES(1, ARRAY [10, 20]); > > When I write my select > SELECT * from tb_cat WHERE id IN (SELECT cat FROM > tb_array WHERE id=1); > the output is: > ERROR: operator does not exist: integer = integer[] > HINT: No operator matches the given name and > argument type(s). You may need > to add explicit type casts. > > Can anyone help me? > thanks. > > > > ---------------------------(end of > broadcast)--------------------------- > TIP 4: Have you searched our list archives? > > http://archives.postgresql.org > __________________________________ Yahoo! Music Unlimited Access over 1 million songs. Try it free. http://music.yahoo.com/unlimited/