Re: merge statement gives error

Поиск
Список
Период
Сортировка
Искать
От
Thomas Kellerer
Тема
Re: merge statement gives error
Дата
Msg-id
a209d716-1699-8ab1-765d-3efc274a458e@gmx.net
Ответ на
Список
Дерево обсуждения
merge statement gives error Abhra Kar <abhra.kar@gmail.com>
Re: merge statement gives error Thomas Kellerer <spam_eater@gmx.net>
Abhra Kar schrieb am 26.02.2018 um 16:02:
> Hi,
> 
>        Trying to execute the following statement ---- 
> 
> 
> merge into ABC as n using dual on (n.id =123)
> 
> when matched update set aaa=222, bbb=333
> 
>  when not matched insert (id, aaa) values (NEXTVAL(id),555);
> 
> 
> 
> but gives syntax error.What should be the proper syntax[ Parameter values are properly passed based on data type].

There is no MERGE statement in Postgres (there might be in Postgres 11, but not currently). 

You will need to use INSERT ON CONFLICT instead. 



В списке pgsql-general по дате отправления
От: Tom Kazimiers
Дата:
От: geoff hoffman
Дата:
FAQ