On Thursday, January 27, 2022, Anand Sowmithiran
wrote:
>
> However, the MS SQL server MERGE command also does 'delete' using the
> 'when not matched' clause, is there an equivalent ?
>
PostgreSQL does not have a merge command feature. Just the subset of
behavior that is INSERT…on conflict
Thanks , that was helpful. I was not framing the right key words during my
searches in SO!
Using the xmax internal column, able to detect if the upsert did an Insert
or Update.
However, the MS SQL server MERGE command also does 'delete' using the 'when
not matched' clause, is there an equivalent ?
On Thu, Jan 27, 2022 at 10:24:14AM +0530, Anand Sowmithiran wrote:
> The INSERT...ON CONFLICT is used for doing upserts in one of our app.
> Our app works with both MS SQL and Postgresql, based on customer needs.
>
> Unlike the MS SQL MERGE command's OUTPUT clause that gives the $action
>
On Thu, Jan 27, 2022 at 5:54 PM Anand Sowmithiran wrote:
> Is there any workaround to get this info ?
There's an undocumented trick:
https://stackoverflow.com/questions/34762732/how-to-find-out-if-an-upsert-was-an-update-with-postgresql-9-5-upsert
On Wednesday, January 26, 2022, Anand Sowmithiran
wrote:
> The INSERT...ON CONFLICT is used for doing upserts in one of our app.
> Our app works with both MS SQL and Postgresql, based on customer needs.
>
> Unlike the MS SQL MERGE command's OUTPUT clause that gives the $action
>
The INSERT...ON CONFLICT is used for doing upserts in one of our app.
Our app works with both MS SQL and Postgresql, based on customer needs.
Unlike the MS SQL MERGE command's OUTPUT clause that gives the $action