Re: copy from csv and postgresql 10's new identity column type - Mailing list pgsql-novice

From Tom Lane
Subject Re: copy from csv and postgresql 10's new identity column type
Date
Msg-id 29836.1513221276@sss.pgh.pa.us
Whole thread Raw
In response to copy from csv and postgresql 10's new identity column type  (john snow <ofbizfanster@gmail.com>)
List pgsql-novice
john snow <ofbizfanster@gmail.com> writes:
> we're porting old dbf's to postgresql 10. currently, we have a dbf that did
> not have a defined primary key. in the postgresql 10 table, we want to
> define a technical primary key using postgresql 10's identity column.

> when we export the dbf data to a csv, the csv does not have data for the
> new primary key column, so the COPY FROM command fails and we get the error
> message saying null is not a valid value for the primary key column.

This sounds like a bug that was fixed last week:

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=ee5b595493e1609903d55709853f5276ba85c81d

You could apply that patch locally, or avoid IDENTITY until 10.2 is out.

            regards, tom lane


pgsql-novice by date:

Previous
From: James Keener
Date:
Subject: Re: copy from csv and postgresql 10's new identity column type
Next
From: john snow
Date:
Subject: r there downsides to explicitly naming a pk column xxxx_pk