X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id B44CA9DCA31 for ; Fri, 24 Mar 2006 11:26:14 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 42871-06 for ; Fri, 24 Mar 2006 11:26:19 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 550789DC890 for ; Fri, 24 Mar 2006 11:26:11 -0400 (AST) Received: from obav06.netvigator.com (obav06.netvigator.com [218.102.62.132]) by svr4.postgresql.org (Postfix) with ESMTP id 998BB5AF975 for ; Fri, 24 Mar 2006 15:26:16 +0000 (GMT) Received: from obav06.netvigator.com (obav01.netvigator.com [127.0.0.1]) by obav06.netvigator.com (Postfix) with SMTP id 87AF3E0A51 for ; Fri, 24 Mar 2006 15:26:07 +0000 (GMT) Received: from n2.netvigator.com ([219.78.154.228]) by wmail05dat.netvigator.com (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20060324152607.DMSG8031.wmail05dat.netvigator.com@n2.netvigator.com> for ; Fri, 24 Mar 2006 23:26:07 +0800 Received: from n2.netvigator.com ([127.0.0.1]) by [127.0.0.1] with ESMTP (SpamPal v1.594) sender ; 24 Mar 2006 23:26:07 +???? Message-Id: <6.2.1.2.0.20060324225743.04d49ac0@localhost> X-Mailer: QUALCOMM Windows Eudora Version 6.2.1.2 Date: Fri, 24 Mar 2006 23:25:00 +0800 To: pgsql-performance@postgresql.org From: K C Lau Subject: limitation using LIKE on ANY(array) In-Reply-To: <20060324133252.GA22688@winnie.fuhr.org> References: <200603170625.k2H6PJ926955@pillette.com> <1143112188.2810.27.camel@theo-laptop.int.coza.net.za> <20060323132448.GB4881@surnet.cl> <4423E90E.2090607@rentalia.com> <20060324125245.GB90527@pervasive.com> <4423EDA9.3090502@rentalia.com> <20060324130619.GF90527@pervasive.com> <20060324133252.GA22688@winnie.fuhr.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=====================_833631218==.ALT" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.441 required=5 tests=[DNS_FROM_RFC_POST=1.44, HTML_MESSAGE=0.001] X-Spam-Score: 1.441 X-Spam-Level: * X-Archive-Number: 200603/500 X-Sequence-Number: 17937 --=====================_833631218==.ALT Content-Type: text/plain; charset="us-ascii"; format=flowed With 8.1.3, I get an error when trying to do this on a Text[] column : .. WHERE ANY(array) LIKE 'xx%' Indeed, I get rejected even with: .. WHERE ANY(array) = 'xx' In both cases, the error is: ERROR: syntax error at or near "any" ... It would only work as documented in the manual (8.10.5): SELECT * FROM sal_emp WHERE 10000 = ANY (pay_by_quarter); It appears that this restriction is still in place in 8.2: >http://developer.postgresql.org/docs/postgres/arrays.html Is that the case? Thanks in advance, KC. --=====================_833631218==.ALT Content-Type: text/html; charset="us-ascii"
With 8.1.3, I get an error when trying to do this on a Text[] column
:
.. WHERE ANY(array) LIKE 'xx%'

Indeed, I get rejected even with:
.. WHERE ANY(array) = 'xx'

In both cases, the error is: ERROR:  syntax error at or near
"any" ... 

It would only work as documented in the manual (8.10.5):
SELECT * FROM sal_emp WHERE 10000 = ANY (pay_by_quarter);

It appears that this restriction is still in place in 8.2:
http://developer.postgresql.org/docs/postgres/arrays.html

Is that the case?

Thanks in advance,
KC. --=====================_833631218==.ALT--