Re: psql \copy

Поиск
Список
Период
Сортировка
От Steve Crawford
Тема Re: psql \copy
Дата
Msg-id CAEfWYyyZQMxWak8WRXZWZ8jZ5+x9QJPvDD5EYGFtrVvFnD4U1Q@mail.gmail.com
обсуждение исходный текст
Ответ на psql \copy  (Steve Clark <steve.clark@netwolves.com>)
Ответы Re: psql \copy
Список pgsql-general
On Fri, Apr 24, 2020 at 8:55 AM Steve Clark <steve.clark@netwolves.com> wrote:
Hello,

I am using psql to copy data extracted from an InfluxDB in csv format into postgresql.
I have a key field on the time field which I have defined as a bigint since the time I get
from InfluxDB is an epoch time.

My question is does psql abort the copy if it hits a duplicate key, or does it keep processing?


The copy will fail. You could import into a temporary table and preprocess then copy to your permanent table or use an ETL solution to remove unwanted data before importing. I don't know the nature of your data or project but perhaps that column isn't suitable for a key.

Cheers,
Steve 

В списке pgsql-general по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: psql \copy
Следующее
От: Steve Clark
Дата:
Сообщение: Re: psql \copy