Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iHT85-00047g-Hp for pgsql-general@arkaria.postgresql.org; Mon, 07 Oct 2019 13:32:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iHT82-0000ZD-Fy for pgsql-general@arkaria.postgresql.org; Mon, 07 Oct 2019 13:32:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iHT82-0000Yr-5V for pgsql-general@lists.postgresql.org; Mon, 07 Oct 2019 13:32:46 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iHT7s-0006gc-G7 for pgsql-general@postgresql.org; Mon, 07 Oct 2019 13:32:43 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x97DWTRX025428; Mon, 7 Oct 2019 09:32:30 -0400 From: Tom Lane To: Tatsuo Ishii cc: andres@anarazel.de, pgsql-general@postgresql.org Subject: Re: RowDescription message In-reply-to: <20191007.215201.2052961183053680920.t-ishii@sraoss.co.jp> References: <20191007.170024.989131059222651917.t-ishii@sraoss.co.jp> <20191007092722.ilnb7xuylvbelow6@alap3.anarazel.de> <20191007.215201.2052961183053680920.t-ishii@sraoss.co.jp> Comments: In-reply-to Tatsuo Ishii message dated "Mon, 07 Oct 2019 21:52:01 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <25426.1570455149.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 07 Oct 2019 09:32:29 -0400 Message-ID: <25427.1570455149@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Tatsuo Ishii writes: >>> According to the manualof RowDescription message >>> https://www.postgresql.org/docs/12/protocol-message-formats.html >>> Specifies the number of fields in a row (can be zero). >>> Does 0 fields could actually happen? >> Yes, e.g.: >> SELECT; > Thanks. Is it a valid SQL statement according to the standard? See select.sgml: Empty <literal>SELECT</literal> Lists The list of output expressions after SELECT can be empty, producing a zero-column result table. This is not valid syntax according to the SQL standard. PostgreSQL allows it to be consistent with allowing zero-column tables. However, an empty list is not allowed when DISTINCT= is used. regards, tom lane