Re: Check for duplicates before inserting new rows

Поиск
Список
Период
Сортировка
От Rich Shepard
Тема Re: Check for duplicates before inserting new rows
Дата
Msg-id alpine.LNX.2.20.2009040736090.7473@salmo.appl-ecosys.com
обсуждение исходный текст
Ответ на Re: Check for duplicates before inserting new rows  (George Woodring <george.woodring@iglass.net>)
Список pgsql-general
On Fri, 4 Sep 2020, George Woodring wrote:

> I would suggest creating a temp table based on the original table and
> loading the data into it first. You can then purge the duplicates.

George,

I hadn't thought of this. Using a duplicate table without a PK would work
well if there's only one attribute that needs checking.

In my case there are two tables involved: locations and measurements. So, I
can create a temporary table from the new data which holds only the
locations. I can then isolate the new location rows that do not already
exist in that table, then insert the new data to eliminate the duplicated
measurements.

Thanks,

Rich




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

Предыдущее
От: George Woodring
Дата:
Сообщение: Re: Check for duplicates before inserting new rows
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Bitmap scan seem like such a strange choice when "limit 1"