Re: [GENERAL] Merge - Insert Select

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: [GENERAL] Merge - Insert Select
Дата
Msg-id CAH2-WzmqT-5F8uqSL0YELdpN7vbVXygr8i5-j4jejuUn38fM5w@mail.gmail.com
обсуждение исходный текст
Ответ на [GENERAL] Merge - Insert Select  (Susan Hurst <susan.hurst@brookhurstdata.com>)
Список pgsql-general
On Fri, Oct 13, 2017 at 9:39 AM, Susan Hurst
<susan.hurst@brookhurstdata.com> wrote:
> Does postgres have a MERGE statement ala Oracle?

No.

> 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.

You can use SELECT instead of VALUES with ON CONFLICT DO NOTHING/ON
CONFLICT DO UPDATE. They don't impose any restriction on the INSERT
statement at all, unlike MERGE, which is fussy about the use of
subqueries.

-- 
Peter Geoghegan


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

В списке pgsql-general по дате отправления:

Предыдущее
От: Susan Hurst
Дата:
Сообщение: [GENERAL] Merge - Insert Select
Следующее
От: Seamus Abshere
Дата:
Сообщение: Re: [GENERAL] "Shared strings"-style table