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 1pfqn1-00066o-Sw for pgsql-general@arkaria.postgresql.org; Fri, 24 Mar 2023 23:25:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pfqmz-00022Y-H7 for pgsql-general@arkaria.postgresql.org; Fri, 24 Mar 2023 23:25:41 +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 1pfqmz-00022O-46 for pgsql-general@lists.postgresql.org; Fri, 24 Mar 2023 23:25:41 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pfqmr-0007kT-Bb for pgsql-general@lists.postgresql.org; Fri, 24 Mar 2023 23:25:40 +0000 Received: by mail-pj1-x1033.google.com with SMTP id a16so2785361pjs.4 for ; Fri, 24 Mar 2023 16:25:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679700331; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=kuKFpGdblra95OGA9M06jBdchv18jYYejbDCRT7/14s=; b=guEkA8UJuQRiz6kUtI1S3RlwtmdqyFoUH7uGZc9DGFVC5yfXVB7t4LanZ4Si/p/1Ig hKVaAFVQDUl0sOrRiyzf/P1RKf6MgpESRND3bc5rdQjeCIcq6uFyh+NMxmo7pQ7DA5AO XL3NEQKle5CJ1pyYNuHqNqTxoDmeOQWOWiW8VjgsstSGfBNj1CYJXZQcUuDUNaa5bUi+ GX6o9QQU6e1wCOe6EpERMXffgJpgAWzYkZTCaeiJFvBiHQjDAxDhVy0iwzjNaxNFjTbb ECDLUKV1DpqHuvuVIJbQSm0vYKTb9amUmmHKSuSBGEC2JAFQY1p5jYPijC4R6bcJBaIL +TQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679700331; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=kuKFpGdblra95OGA9M06jBdchv18jYYejbDCRT7/14s=; b=db6f/YZiRQzQXCUmUxB6SuGL2VFOUgRWoNpeukfyCq7gZ2Rf0mqormlN5omU5SpPDX jurBKdglzb04TDJjkvD8RnWYB8GeUqzSB6B72B33pgxNyJAC4z86PaMdSRBEpRTcQv/E JqTPWWbqCC+5d3NlMPn0L8rTCCO34c0x+7fXum/Lburel/wqKBUp10FDYdcMvRW2XYpS gy4o8gEaaMpT81fmTVxKq9nNwDH9md4ULD9Ioy9x7SbW5DcrEArUbnO9rd6/EMIO8HNT JjexDevyq631/NQZmoHpQ/xn5Tb5Pmvy687JRArJR6i2ZNiDhgLfdN+bLv6MQtN9Tnrk SPBw== X-Gm-Message-State: AAQBX9dYTKY4lBCfY+Su8h8gYX+mQyG88IP0r5MvzJRBHRNSKRus/Hyh F9Ke7wsdUHBVzIwj5v8qYCE= X-Google-Smtp-Source: AKy350Z+zh/C3VhnZP8J954ktmGVCO/ZhP/uOTr1Fn0RLoD1TJzESqfh7ScCiEAae5AQqU1Oq/KOeg== X-Received: by 2002:a17:90b:4b51:b0:22b:b375:ec3f with SMTP id mi17-20020a17090b4b5100b0022bb375ec3fmr4428516pjb.21.1679700330684; Fri, 24 Mar 2023 16:25:30 -0700 (PDT) Received: from ?IPV6:2601:681:5a00:f790:8a29:e239:83a4:da2e? ([2601:681:5a00:f790:8a29:e239:83a4:da2e]) by smtp.gmail.com with ESMTPSA id je1-20020a170903264100b001a1ddd224desm8306103plb.89.2023.03.24.16.25.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Mar 2023 16:25:30 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------2lmpWa4kG0JMxgW4IwFL5R4q" Message-ID: <8466823d-0b88-883e-ef51-e5df047bbe91@gmail.com> Date: Fri, 24 Mar 2023 17:25:29 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: psql \copy with multi-line query Content-Language: en-CA To: "David G. Johnston" Cc: "pgsql-generallists.postgresql.org" References: <89a56b8a-6876-eeb3-12d6-a0761581ce1d@gmail.com> From: Rob Sargent In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------2lmpWa4kG0JMxgW4IwFL5R4q Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 3/24/23 17:14, David G. Johnston wrote: > On Fri, Mar 24, 2023 at 4:04 PM Rob Sargent wrote: > > Using version 13 psql on version 14 server and having trouble > sending a multi-line select in the \copy.  I don't see any remark > about this in the man page. > > > The copy meta-command cannot contain newlines.  You should use "COPY > ... TO STDOUT" directly instead. > > All of this is discussed under "\copy" in the documentation (including > notes). > > https://www.postgresql.org/docs/current/app-psql.html > > David J. > Thank you.  I realize now I went to COPY not \copy docs. --------------2lmpWa4kG0JMxgW4IwFL5R4q Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 3/24/23 17:14, David G. Johnston wrote:
On Fri, Mar 24, 2023 at 4:04 PM Rob Sargent <robjsargent@gmail.com> wrote:
Using version 13 psql on version 14 server and having trouble sending a multi-line select in the \copy.  I don't see any remark about this in the man page.

The copy meta-command cannot contain newlines.  You should use "COPY ... TO STDOUT" directly instead.

All of this is discussed under "\copy" in the documentation (including notes).


David J.

Thank you.  I realize now I went to COPY not \copy docs.


--------------2lmpWa4kG0JMxgW4IwFL5R4q--