Merge - Insert Select

From: Susan Hurst <susan(dot)hurst(at)brookhurstdata(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Merge - Insert Select
Date: 2017-10-13 16:39:00
Message-ID: a555a931f7634d59081023162c4630b4@mail.brookhurstdata.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

What is the best practice for doing an INSERT...SELECT statement for new
values only. Existing values must be excluded from the insert.

Does postgres have a MERGE statement ala Oracle?

I have found examples online for INSERT...ON CONFLICT DO NOTHING, but
all of those examples use VALUES statements, which is not the scenario
that I have.

Thanks for your help!

Sue

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Susan E Hurst
Principal Consultant
Brookhurst Data LLC
Email: susan(dot)hurst(at)brookhurstdata(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Geoghegan 2017-10-13 16:43:28 Re: Merge - Insert Select
Previous Message Melvin Davidson 2017-10-13 16:29:53 Re: "Shared strings"-style table