X-Original-To: pgsql-docs-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id DA3F19FA2CA for ; Fri, 15 Sep 2006 18:49:49 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 23771-09 for ; Fri, 15 Sep 2006 21:49:41 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id A70A79FA6B7 for ; Fri, 15 Sep 2006 18:49:41 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k8FLnc2N006628; Fri, 15 Sep 2006 17:49:38 -0400 (EDT) To: Alvaro Herrera cc: pgsql-docs@postgreSQL.org, Joe Conway Subject: Re: Proposal for documenting 8.2 VALUES syntax In-reply-to: <20060915212052.GB17919@alvh.no-ip.org> References: <6015.1158354891@sss.pgh.pa.us> <20060915212052.GB17919@alvh.no-ip.org> Comments: In-reply-to Alvaro Herrera message dated "Fri, 15 Sep 2006 17:20:53 -0400" Date: Fri, 15 Sep 2006 17:49:38 -0400 Message-ID: <6627.1158356978@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200609/14 X-Sequence-Number: 3701 Alvaro Herrera writes: > ... One likely useful example, if not already covered, is > select ... FROM ... WHERE op ANY (VALUES ( ... )) > I tripped over it a couple of days ago and it seems useful and non > obvious. ISTM it beats the current practice of > op ANY(ARRAY[ ... ]) > which seems a bit of a kludge. Unfortunately, we don't optimize the former nearly as well as the latter :-(. I was thinking of showing an example of a multi-column IN: where (firstname,lastname) in (values ('joe','blow'), ('anne','smith'), ... but I don't think we want to encourage people to use it in cases where a scalar list or ANY(ARRAY) will serve. Maybe next year ;-) regards, tom lane