Re: Bulk inserts into two (related) tables

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: PostgreSQL General <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Bulk inserts into two (related) tables
Date: 2019-05-21 17:27:12
Message-ID: alpine.LNX.2.20.1905211026000.6551@salmo.appl-ecosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 21 May 2019, Michael Lewis wrote:

> For each row-
> Insert into organizations table if the record does not exist, returning ID.
> Insert into people using that ID.

Michael,

The org_id will not exist until I run the insert script.

> Else, load all the data with empty ID column on person table,then just
> update the person table afterward and drop the org name column.

Then I'll copy the org_id numbers to the appropriate row(s) in the people
table.

Thanks,

Rich

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2019-05-21 17:29:35 Re: Bulk inserts into two (related) tables
Previous Message Fabrízio de Royes Mello 2019-05-21 17:27:01 Re: Refresh Publication takes hours and doesn´t finish