Skip site navigation (1) Skip section navigation (2)

COPY FROM with a serial not null column

From: John Taylor <postgres(at)jtresponse(dot)co(dot)uk>
To: "PgSQL Novice" <pgsql-novice(at)postgresql(dot)org>
Subject: COPY FROM with a serial not null column
Date: 2002-08-16 15:20:40
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice

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 ?



pgsql-novice by date

Next:From: Oliver ElphickDate: 2002-08-16 16:19:11
Subject: Re: COPY FROM with a serial not null column
Previous:From: Tom LaneDate: 2002-08-16 14:11:46
Subject: Re: Is my database done for?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group