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 BEBABD6FF4 for ; Thu, 17 Nov 2005 05:26:41 -0400 (AST) 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 09554-04 for ; Thu, 17 Nov 2005 09:26:42 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.177]) by svr1.postgresql.org (Postfix) with ESMTP id A5269D6853 for ; Thu, 17 Nov 2005 05:26:38 -0400 (AST) Received: from [194.25.154.138] (helo=webserv.wug.de) by mrelayeu.kundenserver.de (node=mrelayeu7) with ESMTP (Nemesis), id 0ML2Dk-1Ecg2R2tJf-0006aF; Thu, 17 Nov 2005 10:26:40 +0100 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1Ecg2Q-0006f5-00 for pgsql-sql@postgresql.org; Thu, 17 Nov 2005 10:26:38 +0100 Date: Thu, 17 Nov 2005 10:26:38 +0100 From: "A. Kretschmer" To: pgsql-sql@postgresql.org Subject: Re: Arrya variable as argument to IN expression Message-ID: <20051117092638.GF20828@webserv.wug-glas.de> Mail-Followup-To: "A. Kretschmer" , pgsql-sql@postgresql.org References: <20051117082851.65703.qmail@web32704.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051117082851.65703.qmail@web32704.mail.mud.yahoo.com> X-DEST: 208 X-MSMail-Priority: High X-Message-Flag: Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect. (Linus Torvalds) X-OS: Linux - weil ich es mir Wert bin! X-Info: registrierter Linux-User 97922 http://counter.li.org User-Agent: mutt-ng 1.5.9i (Linux) X-Provags-ID: kundenserver.de abuse@kundenserver.de login:51ea9561fc3f6d9539a2acd743e4748c X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.394 required=5 tests=[AWL=0.000, MISSING_MIMEOLE=1.394] X-Spam-Score: 1.394 X-Spam-Level: * X-Archive-Number: 200511/124 X-Sequence-Number: 23375 am 17.11.2005, um 0:28:51 -0800 mailte Emil Kaffeshop folgendes: > Hello I am trying the following: > a INTEGER[] := ''{10,15,20}''; > b INTEGER := 15; > flag BOOLEAN := FALSE; > > SELECT b IN (a) INTO flag; !!! does not work Sorry, i can't understand your query. Perhaps you are searchfing for something like: test=# select * from foo; a | b | flag ---------+---+------ {1,2,3} | 1 | t {5,6,7} | 1 | t (2 rows) test=# select * from foo where b = any(a); a | b | flag ---------+---+------ {1,2,3} | 1 | t (1 row) > > Is it legal to expect the array to be interpret as > list of integers which IN expression takes ? Please read http://www.postgresql.org/docs/8.1/interactive/arrays.html to learn more about arrays. HTH, Andreas -- Andreas Kretschmer (Kontakt: siehe Header) Heynitz: 035242/47212, D1: 0160/7141639 GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net === Schollglas Unternehmensgruppe ===