agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: Adrian Klaver <adrian.klaver@aklaver.com>
To: masyaf <kavtaradze.s@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: query option in COPY postgres
Date: Mon, 9 Nov 2015 09:13:40 -0800
Message-ID: <5640D444.30801@aklaver.com> (raw)
In-Reply-To: <1446850486076-5873038.post@n5.nabble.com>
References: <1446841356122-5873015.post@n5.nabble.com>
<563D2C74.8050408@aklaver.com>
<1446850486076-5873038.post@n5.nabble.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>
On 11/06/2015 02:54 PM, masyaf wrote:
> Can you give any details about that?
>
I am assuming you are referring to COPY FROM a program.
Take a look at the docs:
http://www.postgresql.org/docs/9.4/interactive/sql-copy.html
"When PROGRAM is specified, the server executes the given command and
reads from the standard output of the program, or writes to the standard
input of the program. The command must be specified from the viewpoint
of the server, and be executable by the PostgreSQL user. When STDIN or
STDOUT is specified, data is transmitted via the connection between the
client and the server."
In my case I would write the program in Python and output CSV. Every
time I do that though, I just go ahead and use the copy_from() method of
the psycopg2 cursor and never get to the above.
>
>
> --
> View this message in context: http://postgresql.nabble.com/query-option-in-COPY-postgres-tp5873015p5873038.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
view thread (5+ messages)
Message-ID: <5640D444.30801@aklaver.com>
Permalink: ../5640D444.30801@aklaver.com/
Also on: postgresql.org/message-id/5640D444.30801@aklaver.com
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-sql@postgresql.org
Cc: adrian.klaver@aklaver.com, kavtaradze.s@gmail.com
Subject: Re: query option in COPY postgres
In-Reply-To: <5640D444.30801@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox