Check for duplicates before inserting new rows - Mailing list pgsql-general

From Rich Shepard
Subject Check for duplicates before inserting new rows
Date
Msg-id alpine.LNX.2.20.2009040613450.7473@salmo.appl-ecosys.com
Whole thread Raw
Responses Re: Check for duplicates before inserting new rows  (George Woodring <george.woodring@iglass.net>)
Re: Check for duplicates before inserting new rows  (Chris Sterritt <chris.sterritt@yobota.xyz>)
List pgsql-general
This is a new issue for me: I've received data from a different source and
need to add non-duplicates to two tables in the database. Each row in the
new data has a station ID and associated measurements.

The existing database includes a table for station information and another
for measurements made there.

I want to learn which stations and which measurements in the new data set
are not included in the existing tables. And, I don't want to try inserting
the new data and have postgres tell me when it's found duplicates,
especially since there are two tables involved.

My research into how to do this has not found a solution so I ask for
pointers to resources that will teach me how to add these new data to both
tables.

Regards,

Rich




pgsql-general by date:

Previous
From: Klaudie Willis
Date:
Subject: Re: Bitmap scan seem like such a strange choice when "limit 1"
Next
From: George Woodring
Date:
Subject: Re: Check for duplicates before inserting new rows