From: | Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> |
---|---|
To: | Rich Shepard <rshepard(at)appl-ecosys(dot)com> |
Cc: | "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Recommended Protocol: Adding Rows to Table |
Date: | 2011-11-25 19:17:15 |
Message-ID: | 4ECFE9BB.8090108@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 11/25/2011 08:49 AM, Rich Shepard wrote:
> On Fri, 25 Nov 2011, David Johnston wrote:
>
>> Simplistically you load all the data into a staging table that has no
>> natural primary key and then write a query that will result in only a
>> single record for whatever you define as a primary key. Insert the
>> results of that query into the final table.
>
> David,
>
> I was leaning toward doing this.
>
>> If you only use a subset of columns to uniquely determine the PK than you
>> need to decide how to resolve situations where the PK fields are
>> duplicated but the extra fields are unique. That step is why the first
>> description is simplistic.
>
> Well, that's point of a PK, isn't it? There should be only one row with
> that specific set of column values. The additional columns are unique to
> that set of PK values.
Gotta love an optimist:)
>
> Thanks,
>
> Rich
>
--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Scott Mead | 2011-11-25 20:00:50 | Re: Recommended Protocol: Adding Rows to Table |
Previous Message | Rich Shepard | 2011-11-25 16:49:40 | Re: Recommended Protocol: Adding Rows to Table |