Re: Populate Table From Two Other Tables - Mailing list pgsql-general

From Rich Shepard
Subject Re: Populate Table From Two Other Tables
Date
Msg-id alpine.LNX.2.00.1206051647000.27613@salmo.appl-ecosys.com
Whole thread Raw
In response to Re: Populate Table From Two Other Tables  ("David Johnston" <polobo@yahoo.com>)
Responses Re: Populate Table From Two Other Tables
List pgsql-general
On Tue, 5 Jun 2012, David Johnston wrote:

> As for the duplicate key I would first check to see if you are inserting
> into a non-empty table and that one or more of your newly inserted records
> conflicts with existing records on the waterchem table.  The easiest way
> would be to insert into a staging table and then join the staging and live
> tables together on the PK and see if any records are returned.

David,

   Since the two separate tables have no duplicates I find it difficult to
understand how combining the two generates a duplicate row.

   In any case, I always drop the table before running the script after
correcting errors so there should not be a previous row with the same
values. Puzzling,

Thanks,

Rich


pgsql-general by date:

Previous
From: "David Johnston"
Date:
Subject: Re: Populate Table From Two Other Tables
Next
From: Dann Corbit
Date:
Subject: Re: I'd like to learn a bit more about how indexes work