Re: COPY FROM and sequences - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: COPY FROM and sequences
Date
Msg-id 20070109223430.GB11072@wolff.to
Whole thread Raw
In response to COPY FROM and sequences  (Matthew Terenzio <matt@jobsforge.com>)
List pgsql-general
On Mon, Jan 08, 2007 at 20:20:42 -0500,
  Matthew Terenzio <matt@jobsforge.com> wrote:
> Is it true that you can't use COPY FROM to fill a table with a SERIAL
> type column?
>
> Or rather, how does one approach that situation most effectively?

In older versions of postgres you couldn't, in recent versions, you can
provide an explicit column list to COPY and the other columns will get
default values. You can't do this row by row though; there is no equivalent
to DEFAULT as used in INSERT statements for COPY.

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: ERROR: invalid memory alloc request size, and others
Next
From: Andrew Kroeger
Date:
Subject: Re: ERROR: invalid memory alloc request size, and others