Re: Insert text to column using copy command - Mailing list pgsql-novice

From Tom Lane
Subject Re: Insert text to column using copy command
Date
Msg-id 21198.1447000537@sss.pgh.pa.us
Whole thread Raw
In response to Insert text to column using copy command  (Shmagi Kavtaradze <kavtaradze.s@gmail.com>)
List pgsql-novice
Shmagi Kavtaradze <kavtaradze.s@gmail.com> writes:
> I want to import text to a specific column and for other columns to specify
> literals/constants myself, using same copy command.

COPY is not bright enough to do what you want.  I'd suggest copying into
a temporary table that just receives the data literally as it appears in
the file, and then using INSERT ... SELECT ... to transform the data and
put it into the final table.

            regards, tom lane


pgsql-novice by date:

Previous
From: Shmagi Kavtaradze
Date:
Subject: Insert text to column using copy command
Next
From: Michael Convey
Date:
Subject: Linux Users vs PostgreSQL Users