COPY from .csv File and Remove Duplicates

Поиск
Список
Период
Сортировка
От Rich Shepard
Тема COPY from .csv File and Remove Duplicates
Дата
Msg-id alpine.LNX.2.00.1108111607310.14240@salmo.appl-ecosys.com
обсуждение исходный текст
Ответы Re: COPY from .csv File and Remove Duplicates  (David Johnston <polobo@yahoo.com>)
Re: COPY from .csv File and Remove Duplicates  (Craig Ringer <ringerc@ringerc.id.au>)
Список pgsql-general
   A table has a sequence to generate a primary key for inserted records with
NULLs in that column.

   I have a .csv file of approximately 10k rows to copy into this table. My
two questions which have not been answered by reference to my postgres
reference book or Google searches are:

   1) Will the sequence automatically add the nextval() to each new record as
the copy command runs?

   2) Many of these rows almost certainly are already in the table. I would
like to remove duplicates either during the COPY command or immediately
after. I'm considering copying the new data into a clone of the table then
running a SELECT to add only those rows in the new cloned table to the
existing table.

   Suggestions on getting these data in without duplicating existing rows
will be very helpful.

TIA,

Rich

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

Предыдущее
От: Naoko Reeves
Дата:
Сообщение: Re: Regex Query Index question
Следующее
От: John DeSoi
Дата:
Сообщение: suggestions for archive_command to a remote standby