Re: copy to program with format binary

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Scott Ribe <scott_ribe(at)elevated-dev(dot)com>, pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: copy to program with format binary
Date: 2021-09-27 14:33:18
Message-ID: 81ba38c29879972e9ccb3025162ef1dfa8582b19.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Ribe 2021-09-27 14:39:34 Re: copy to program with format binary
Previous Message Scott Ribe 2021-09-27 14:24:35 copy to program with format binary