Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1av9am-0004l3-ED for pgsql-bugs@arkaria.postgresql.org; Tue, 26 Apr 2016 20:28:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1av9am-0006u5-0g for pgsql-bugs@arkaria.postgresql.org; Tue, 26 Apr 2016 20:28:20 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1av9a9-0006Cx-3O for pgsql-bugs@postgresql.org; Tue, 26 Apr 2016 20:27:41 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1av9a6-0005Av-5H for pgsql-bugs@postgresql.org; Tue, 26 Apr 2016 20:27:39 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1av9a5-0004AG-2w; Tue, 26 Apr 2016 16:27:37 -0400 Date: Tue, 26 Apr 2016 16:27:37 -0400 From: Bruce Momjian To: "David G. Johnston" Cc: manlio.perillo@gmail.com, "pgsql-bugs@postgresql.org" Subject: Re: BUG #14016: Incomplete documentation of IN subquery expression Message-ID: <20160426202737.GA13058@momjian.us> References: <20160311163928.6674.94707@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="5mCyUwZo2JvN/JJP" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -2.9 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --5mCyUwZo2JvN/JJP Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Fri, Mar 11, 2016 at 10:02:01AM -0700, David G. Johnston wrote: > On Fri, Mar 11, 2016 at 9:39 AM, wrote: > > At the end of the documentation for VALUE (sql-values.html), there is the > following tip: > "For simple IN tests, it's better to rely on the list-of-scalars form of IN > than to write a VALUES query as shown above" > > However there is no reference to the "list-of-scalars" forms of IN, in the > functions-subquery.html page.  It is only reported that the supported > syntax > is "expression IN (subquery)" > > The reference was available in an old version (7.3), where the manual > documented both the scalar form and sub query form: > "expression IN (value[, ...])" > > > ​It was moved... > > ​http://www.postgresql.org/docs/9.5/interactive/functions-comparisons.html# > AEN20283 > > ​The interpretation being that a "list of scalars" is, in this situation, > semantically equivalent to an array - though having the later you would have to > use "=ANY(array)" instead of "IN" > > ​Apparently someone disagreed with the note in the subquery section: > > >>>Note: This form of IN is not truly a subquery expression, but it seems best > to document it in the same place as subquery IN. Does the attached patch improve this? -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription + --5mCyUwZo2JvN/JJP Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="in.diff" diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml new file mode 100644 index eb2a0c5..bef458a *** a/doc/src/sgml/func.sgml --- b/doc/src/sgml/func.sgml *************** WHERE EXISTS (SELECT 1 FROM tab2 WHERE c *** 14590,14596 **** Boolean (true/false) results. ! <literal>IN</literal> --- 14590,14596 ---- Boolean (true/false) results. ! <literal>IN</literal> diff --git a/doc/src/sgml/ref/values.sgml b/doc/src/sgml/ref/values.sgml new file mode 100644 index 0fb3cd7..b992ce3 *** a/doc/src/sgml/ref/values.sgml --- b/doc/src/sgml/ref/values.sgml *************** WHERE ip_address IN (VALUES('192.168.0.1 *** 219,225 **** For simple IN tests, it's better to rely on the ! list-of-scalars form of IN than to write a VALUES query as shown above. The list of scalars method requires less writing and is often more efficient. --- 219,226 ---- For simple IN tests, it's better to rely on the ! list-of-scalars form ! of IN than to write a VALUES query as shown above. The list of scalars method requires less writing and is often more efficient. --5mCyUwZo2JvN/JJP Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs --5mCyUwZo2JvN/JJP--