From: Scott Ribe <scott_ribe@elevated-dev.com>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: copy to program with format binary
Date: Mon, 27 Sep 2021 08:39:34 -0600
Message-ID: <311C3978-05A3-4203-B9C5-C9DB552DAEEB@elevated-dev.com> (raw)
In-Reply-To: <81ba38c29879972e9ccb3025162ef1dfa8582b19.camel@cybertec.at>
References: <1BE15609-573B-4D14-906A-B9B360C7666D@elevated-dev.com>
<81ba38c29879972e9ccb3025162ef1dfa8582b19.camel@cybertec.at>
Thank you!
I was staring at the docs and just totally missing the '('...
Small oddity though, I tried the 'encoding' option same as I tried format, without the parens, and it worked--which really threw me off.
--
Scott Ribe
scott_ribe@elevated-dev.com
https://www.linkedin.com/in/scottribe/> On Sep 27, 2021, at 8:33 AM, Laurenz Albe <laurenz.albe@cybertec.at> wrote:
>
> On Mon, 2021-09-27 at 08:24 -0600, Scott Ribe wrote:
>> Are the "to program" and binary format not compatible?
>>
>> copy msgs (msg) to program 'bzip2 > /...' with format binary
>>
>> gives me a syntax error at "format"
>>
>> Trying older-style syntax without "with" does the same thing.
>
> The correct syntax is:
>
> COPY msgs (msg) TO PROGRAM 'bzip2 > /...' WITH (FORMAT 'binary');
>
> Yours,
> Laurenz Albe
> --
> Cybertec | https://www.cybertec-postgresql.com
>
>
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: scott_ribe@elevated-dev.com, laurenz.albe@cybertec.at, pgsql-admin@lists.postgresql.org
Subject: Re: copy to program with format binary
In-Reply-To: <311C3978-05A3-4203-B9C5-C9DB552DAEEB@elevated-dev.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox