pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Scott Ribe <scott_ribe@elevated-dev.com>
To: pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: copy to program with format binary
Date: Mon, 27 Sep 2021 16:33:18 +0200
Message-ID: <81ba38c29879972e9ccb3025162ef1dfa8582b19.camel@cybertec.at> (raw)
In-Reply-To: <1BE15609-573B-4D14-906A-B9B360C7666D@elevated-dev.com>
References: <1BE15609-573B-4D14-906A-B9B360C7666D@elevated-dev.com>

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






view thread (3+ messages)  latest in thread

Message-ID: <81ba38c29879972e9ccb3025162ef1dfa8582b19.camel@cybertec.at>
Permalink:  ../81ba38c29879972e9ccb3025162ef1dfa8582b19.camel@cybertec.at/
Also on:    postgresql.org/message-id/81ba38c29879972e9ccb3025162ef1dfa8582b19.camel@cybertec.at

 · 

reply

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: laurenz.albe@cybertec.at, scott_ribe@elevated-dev.com, pgsql-admin@lists.postgresql.org
  Subject: Re: copy to program with format binary
  In-Reply-To: <81ba38c29879972e9ccb3025162ef1dfa8582b19.camel@cybertec.at>

* 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