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 1kMtUQ-0006Ag-TX for pgsql-bugs@arkaria.postgresql.org; Mon, 28 Sep 2020 13:46:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kMtTu-0003zj-99 for pgsql-bugs@arkaria.postgresql.org; Mon, 28 Sep 2020 13:46:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kMtTu-0003za-0a for pgsql-bugs@lists.postgresql.org; Mon, 28 Sep 2020 13:46:18 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kMtTp-0003q2-Sf for pgsql-bugs@lists.postgresql.org; Mon, 28 Sep 2020 13:46:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:To:Sender:From:Date:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ovZx8L49JwVw5dtU0raNGqXvMaJX8cWQtOEvukX8PBU=; b=QVkbr9Ngk6ES/UXIdXDLB9CYTI wVCJGulP/Zt24skBt69f8FKI5dczPM7g3cj2l5pIY9bollMpQTfIdSOLiAMRsBU3drHcyQ5D4QB9D 0Ttj+gwEp8KHrs4MVE+UrVrm0BCQ3eopiELKw9PZPDyNWCEOIYm73qJ+iv2Gqqoy3H7o=; Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by depesz.com with esmtpa (Exim 4.92) (envelope-from ) id 1kMtTm-0005jg-P5; Mon, 28 Sep 2020 15:46:10 +0200 Date: Mon, 28 Sep 2020 15:46:10 +0200 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: buschmann@nidsa.net, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16639: Syntax error in pgsql when executing local \copy instead of SQL copy Message-ID: <20200928134610.GA9565@depesz.com> Reply-To: depesz@depesz.com References: <16639-ec6ab8b4776f64b2@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <16639-ec6ab8b4776f64b2@postgresql.org> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Sep 28, 2020 at 01:25:08PM +0000, PG Bug reporting form wrote: > The following bug has been logged on the website: > > Bug reference: 16639 > Logged by: Hans Buschmann > Email address: buschmann@nidsa.net > PostgreSQL version: 13.0 > Operating system: Linux x64 or Windows 64bit > Description: > > Deriving from a much longer query in our application I managed to extract a > short query which shows the error for $subject: > > > \copy ( > with \copy is psql command, and has to be in single line. You can see it by entering: \copy ( and then pressing enter in psql. Docs mention: >> Another way to obtain the same result as \copy ... to is to use the SQL COPY >> ... TO STDOUT command and terminate it with \g filename or \g |program. Unlike >> \copy, this method allows the command to span multiple lines; also, variable >> interpolation and backquote expansion can be used. Best regards, depesz