Re: Bulk Insert/Update Scenario

From: Jordan Deitch <jwdeitch(at)gmail(dot)com>
To: Mana M <manan(dot)gcs(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Bulk Insert/Update Scenario
Date: 2018-01-04 20:43:10
Message-ID: CAK1UM_bUBat2jEbHxbazjjVbXFUGfj859TJkNrOB_twG7bDBnw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Mana,

A starting point would be reading about the batch upsert functionality:
https://www.postgresql.org/docs/current/static/sql-insert.html

You would do something like:
INSERT INTO table ON CONFLICT update...

This operation would be atomic. You can also look into deferrable
constraints such that you would perform all your insert / update operations
in a transaction block and accommodate for the constraints.

I hope this helps to get you on the right track!

Thanks,
Jordan Deitch
http://id.rsa.pub

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message legrand legrand 2018-01-04 21:19:53 Re: Bulk Insert/Update Scenario
Previous Message Mana M 2018-01-04 19:39:41 Bulk Insert/Update Scenario