Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lr62n-0004pL-4T for pgsql-docs@arkaria.postgresql.org; Wed, 09 Jun 2021 21:47:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lr62l-0006wT-T5 for pgsql-docs@arkaria.postgresql.org; Wed, 09 Jun 2021 21:47:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lr62l-0006wL-Mw for pgsql-docs@lists.postgresql.org; Wed, 09 Jun 2021 21:47:23 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lr62j-0003fN-QZ for pgsql-docs@lists.postgresql.org; Wed, 09 Jun 2021 21:47:23 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 159LlI7o1510078; Wed, 9 Jun 2021 17:47:18 -0400 From: Tom Lane To: Laurenz Albe cc: neilbower@gmail.com, pgsql-docs@lists.postgresql.org Subject: Re: SQL Commands COPY In-reply-to: References: <162326849405.14468.13255406860802922380@wrigleys.postgresql.org> Comments: In-reply-to Laurenz Albe message dated "Wed, 09 Jun 2021 23:31:18 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1510076.1623275238.1@sss.pgh.pa.us> Date: Wed, 09 Jun 2021 17:47:18 -0400 Message-ID: <1510077.1623275238@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Laurenz Albe writes: > On Wed, 2021-06-09 at 19:54 +0000, PG Doc comments form wrote: >> When using psql (version 13.3) against a version 13 cluster, the method >> shown in the compatibility section works whereas the methods shown in the >> synopsis and parameters sections do not work and will throw a syntax >> error. > You must be misreading something, the new syntax works: > COPY (SELECT 42 AS x) TO STDOUT (FORMAT 'csv', FORCE_QUOTE (x)); The most probable explanation seems to be that the OP is actually connecting to an 8.4 (or older) PG server. regards, tom lane