Re: query option in COPY postgres - Mailing list pgsql-sql

From Adrian Klaver
Subject Re: query option in COPY postgres
Date
Msg-id 563D2C74.8050408@aklaver.com
Whole thread Raw
In response to query option in COPY postgres  (masyaf <kavtaradze.s@gmail.com>)
Responses Re: query option in COPY postgres
List pgsql-sql
On 11/06/2015 12:22 PM, masyaf wrote:
> According to COPY documentation , I can use query option when exporting data.
> Can I use query VALUES when loading data into tables from txt file? If I
> have 2 columns and I want to insert record manually in the first
> column(SentenceID) and insert data in the second column(Sentence) from text
> file. Is it something like:
>
> copy foo1(Sentence) | (VALUES (2339)) from '/path/to/sentence.txt' with
> delimiter '*';

In addition to what David posted, in Postgres 9.3+ you have option of 
doing COPY FROM a program instead of a file. This opens the possibility 
of using an external program to get your data into the form and order 
you need and then have COPY pull from that.
>
> How to use exactly options in COPY command, it has {} | [] symbols in
> documentation.
>
>
>
> --
> View this message in context: http://postgresql.nabble.com/query-option-in-COPY-postgres-tp5873015.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



pgsql-sql by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: query option in COPY postgres
Next
From: masyaf
Date:
Subject: Re: query option in COPY postgres