Re: copy from csv and postgresql 10's new identity column type

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: copy from csv and postgresql 10's new identity column type
Дата
Msg-id 29836.1513221276@sss.pgh.pa.us
обсуждение исходный текст
Ответ на copy from csv and postgresql 10's new identity column type  (john snow <ofbizfanster@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: James Keener
Дата:
Сообщение: Re: copy from csv and postgresql 10's new identity column type
Следующее
От: john snow
Дата:
Сообщение: r there downsides to explicitly naming a pk column xxxx_pk