Re: COPY with default values? - Mailing list pgsql-general

From Tom Lane
Subject Re: COPY with default values?
Date
Msg-id 5108.990801221@sss.pgh.pa.us
Whole thread Raw
In response to COPY with default values?  (Jeff Boes <jboes@nexcerpt.com>)
Responses Re: COPY with default values?  (Jeff Boes <jboes@nexcerpt.com>)
Compilation fails --with-ssl on Solaris 8  (Arcady Genkin <a.genkin@utoronto.ca>)
List pgsql-general
Jeff Boes <jboes@nexcerpt.com> writes:
> Now I would like to initialize this table with a COPY statement, but
> without supplying values for the primary key.

COPY does not deal with insertion of default values.  Sorry.

One rather klugy answer is to COPY to a temp table that has only the
columns you want to supply, and then INSERT ... SELECT into the main
table.  Might be faster if there are enough rows involved.

            regards, tom lane

pgsql-general by date:

Previous
From: Manuel Durán Aguete
Date:
Subject: [URGENT] How to generata a unique string id
Next
From: Jeff Boes
Date:
Subject: Re: COPY with default values?