Re: [EXTERNAL]: Re: [EXTERNAL]: Re: UPSERT in Postgres - Mailing list pgsql-general

From Rob Sargent
Subject Re: [EXTERNAL]: Re: [EXTERNAL]: Re: UPSERT in Postgres
Date
Msg-id bd8b994f-adcf-766d-7766-2d83f0ba4139@gmail.com
Whole thread Raw
In response to RE: [EXTERNAL]: Re: [EXTERNAL]: Re: UPSERT in Postgres  (Louis Tian <louis.tian@aquamonix.com.au>)
Responses Re: [EXTERNAL]: Re: [EXTERNAL]: Re: UPSERT in Postgres
Re: [EXTERNAL]: Re: [EXTERNAL]: Re: UPSERT in Postgres
List pgsql-general
On 4/9/23 19:55, Louis Tian wrote:
> Hi Alban,
>
> "I am not expecting an error here", by "here" I means when doing a TRUE UPSERT (an upsert current does not exist in
Postgres).
> I am NOT referring to an "Insert on conflict do update" (which despite its intention and wide acceptance is not fully
equivalentto a true upsert).
 
> I understand the error I am getting now is due to not null constraint given how "insert on conflict" works.
>
> An UPSERT checks whether a row exists, if so, it does an update, if not it does an insert. This is the literal
definition.

This the part that's always eluded me: How does the client, the 
UPSERTer, come to hold an id and not know whether or not it's already in 
the database.




pgsql-general by date:

Previous
From: Louis Tian
Date:
Subject: RE: [EXTERNAL]: Re: [EXTERNAL]: Re: UPSERT in Postgres
Next
From: Adrian Klaver
Date:
Subject: Re: [EXTERNAL]: Re: [EXTERNAL]: Re: UPSERT in Postgres