Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 2086A634122 for ; Tue, 18 Aug 2009 07:17:10 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 46351-02 for ; Tue, 18 Aug 2009 10:17:04 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-bw0-f208.google.com (mail-bw0-f208.google.com [209.85.218.208]) by mail.postgresql.org (Postfix) with ESMTP id 7CBCF6337AB for ; Tue, 18 Aug 2009 07:17:04 -0300 (ADT) Received: by bwz4 with SMTP id 4so3002836bwz.24 for ; Tue, 18 Aug 2009 03:17:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=RMYy9VvXlCxltevkVDhUd1ZjTJt86wiO7FReE/SHTtk=; b=XuwSbXx2NbINuQick2N1gBzNB35sp1djRDmcNFIIes5a9dap1xEcGTZpnJSvC1lH7e 5pfIU2fg5k0mFRpeaSuJhCu3+EEj5VJX6DWhQtD+ZZkbfRAfDF3d5wWEXqwYG1QhHhPr H1qcQQf+7q3icF8UkvLAIuNAedwYzBE5bLTx4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=jSFKqYEHMMLv0TknT7UDpaHtS10In9s+2b7cp/s9RcekSl/jjCwmkLilDZefMqQze2 jyqbg48M+45dBwLBiH394RZL/xAxBGid+8dTOBKRurGiUmwBzbSBCfgee6kL4po/r/HO T8Er4ilmsD7YwIZ6XVicuIr6a7BI4F95QgaJ0= Received: by 10.102.249.10 with SMTP id w10mr1788911muh.49.1250590621865; Tue, 18 Aug 2009 03:17:01 -0700 (PDT) Received: from ?192.168.0.100? ([95.108.20.1]) by mx.google.com with ESMTPS id e8sm23099693muf.36.2009.08.18.03.17.00 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 18 Aug 2009 03:17:00 -0700 (PDT) Message-ID: <4A8A7F9A.3070906@gmail.com> Date: Tue, 18 Aug 2009 12:16:58 +0200 From: "W. Kinastowski" User-Agent: Thunderbird 2.0.0.22 (X11/20090605) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: operator contains in older Pgsql References: <4A8A5C8C.40809@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/87 X-Sequence-Number: 32996 Jasen Betts wrote: > On 2009-08-18, W. Kinastowski wrote: > >> I need a functionality of "@>" array operator in 8.1 Pg server. i.ex. >> SELECT * FROM table WHERE array_col @> ARRAY ['xxx'] (works in 8.2, >> error in 8.1) >> How to performe such a query ? Is it possible ? Thanks for help. >> > > SELECT * FROM table WHERE 'xxx' = ANY( array_col ) > > > thanks, it works ... and when there is more elements in array: i.ex SELECT * FROM table WHERE array_col @> ARRAY ['xxx', 'yyy'] i need to SELECT * FROM table WHERE 'xxx' = ANY( array_col ) AND 'yyy' = ANY( array_col ) is that correct ?