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 7FA319F9F44 for ; Fri, 15 Sep 2006 18:21:10 -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 23235-06 for ; Fri, 15 Sep 2006 21:21:01 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from lists.commandprompt.com (host-130.commandprompt.net [207.173.203.130]) by postgresql.org (Postfix) with ESMTP id 3EB329FA621 for ; Fri, 15 Sep 2006 18:20:59 -0300 (ADT) Received: from alvh.no-ip.org (201-221-217-241.bk12-dsl.surnet.cl [201.221.217.241]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k8FLKwfd010904; Fri, 15 Sep 2006 14:21:00 -0700 Received: by alvh.no-ip.org (Postfix, from userid 1000) id 7107AC94CA2; Fri, 15 Sep 2006 17:20:53 -0400 (CLT) Date: Fri, 15 Sep 2006 17:20:53 -0400 From: Alvaro Herrera To: Tom Lane Cc: pgsql-docs@postgreSQL.org, Joe Conway Subject: Re: Proposal for documenting 8.2 VALUES syntax Message-ID: <20060915212052.GB17919@alvh.no-ip.org> Mail-Followup-To: Tom Lane , pgsql-docs@postgreSQL.org, Joe Conway References: <6015.1158354891@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6015.1158354891@sss.pgh.pa.us> User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: ClamAV version 0.88.4, clamav-milter version 0.88.4 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Fri, 15 Sep 2006 14:21:00 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200609/13 X-Sequence-Number: 3700 Tom Lane wrote: > I spent a bit of time thinking about the best way to document 8.2's more > powerful VALUES clause. Here's the plan I came up with: > > * There needs to be some introductory material in Part II, and the only > place it seems to fit at all is under Chapter 7, Queries. I think there > should be a new page covering VALUES. We could add it at the > end of the chapter (ie, a new section 7.7) or we could insert it between > sections 7.3 Select Lists and 7.4 Combining Queries. The argument for > the latter position is that VALUES is now syntactically parallel to > SELECT, and so you can use it as if it were SELECT in UNION/INTERSECT/ > EXCEPT structures as described in 7.4, as well as attach the ORDER BY, > LIMIT, OFFSET clauses described in 7.5 and 7.6. However that might be > putting too much emphasis on syntactic form as opposed to pedagogical > clarity. I'm a bit inclined to put it at the end of the chapter and > then explain "by the way, you can also attach that other stuff to it". > Thoughts? I agree with putting it at the end of the chapter. > * The SELECT reference page is huge already, so I would rather add only > the minimum possible amount to it. This leads to the conclusion that > we'd better create a new ref/ entry just for VALUES. I think that's > appropriate anyway, since there is some material that doesn't seem like > it would fit anywhere else --- in particular, that we want to warn off > people from expecting umpteen-billion-row VALUES constructs to work > well. I agree here as well. 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. -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support