Re: copy to program with format binary

From: Scott Ribe <scott_ribe(at)elevated-dev(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: copy to program with format binary
Date: 2021-09-27 14:39:34
Message-ID: 311C3978-05A3-4203-B9C5-C9DB552DAEEB@elevated-dev.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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(at)elevated-dev(dot)com
https://www.linkedin.com/in/scottribe/

> On Sep 27, 2021, at 8:33 AM, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)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
>
>
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Axel Rau 2021-09-28 20:55:22 Can't drop logical replication slot
Previous Message Laurenz Albe 2021-09-27 14:33:18 Re: copy to program with format binary