COPY FROM with a serial not null column - Mailing list pgsql-novice

From John Taylor
Subject COPY FROM with a serial not null column
Date
Msg-id 02081616204005.01454@splash.hq.jtresponse.co.uk
Whole thread Raw
Responses Re: COPY FROM with a serial not null column  (Oliver Elphick <olly@lfix.co.uk>)
List pgsql-novice
Hi,

I'm having trouble using COPY FROM with a table that has a serial NOT NULL column.

If I use psql to INSERT with a NULL value for the appropriate column, everything
works fine, and the next value in the sequence is inserted.

However, if I use COPY table FROM filename, I get an error:
ERROR:  copy: line 1, CopyFrom: Fail to add null value in not null attribute seq

(The column in question is called seq).

Does anyone have ideas how I can get this to work ?


Thanks
JohnT

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: Is my database done for?
Next
From: Oliver Elphick
Date:
Subject: Re: COPY FROM with a serial not null column