Re: upsert example about postgres9.5 - Mailing list pgsql-admin

From koff10
Subject Re: upsert example about postgres9.5
Date
Msg-id BLU437-SMTP8F617F3039AAF88CEF289CA950@phx.gbl
Whole thread Raw
In response to Re: upsert example about postgres9.5  ("Gilberto Castillo" <gilberto.castillo@etecsa.cu>)
List pgsql-admin
Thanks for your reply.
So there is no Sql instruction like UPSERT !

koff.

Le 12/04/2016 23:23, Gilberto Castillo a écrit :
>> Hi all,
>>
>> It's known that postgres 9.5 has introduce  upsert  instruction.
>> Is somebody can show  me how to use this instruction ?
>> Do the UPSERT commande exists in  SQL ?
>>
>
> insert into accesos_usuarios (usuarios, accesos)
> values ('8kdata',1)
> on conflict (usuarios)
> do update set
> accesos = accesos_usuarios.accesos + EXCLUDED.accesos;
>
> insert into accesos_usuarios (usuarios, accesos)
> values ('8kdata',1), ('8kdata2',1)
> on conflict do nothing;
>
> Tomado de un presentación de Alvaro Hernadez  En Cuba
>



pgsql-admin by date:

Previous
From: "Gilberto Castillo"
Date:
Subject: Re: upsert example about postgres9.5
Next
From: Bryan Ward
Date:
Subject: Postgresql 9.0.23 - checkpoint delays