Re: Bulk inserts into two (related) tables

From: Michael Lewis <mlewis(at)entrata(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: Rich Shepard <rshepard(at)appl-ecosys(dot)com>, PostgreSQL General <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Bulk inserts into two (related) tables
Date: 2019-05-21 17:22:07
Message-ID: CAHOFxGp65_ViUsQ4MfybXj5rNUPrOAzWVeiurY7Jx1TQjNr7UA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

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.

Perhaps I am missing something.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2019-05-21 17:24:03 Re: Bulk inserts into two (related) tables
Previous Message Rich Shepard 2019-05-21 17:22:03 Re: Bulk inserts into two (related) tables