Re: how to return data from insert into ... on conflict ... returning ... into

2023-07-11 Thread Gurjeet Singh
On Tue, Jun 20, 2023 at 1:26 PM Les wrote: > > https://www.postgresql.org/docs/current/sql-insert.html#SQL-ON-CONFLICT > > and the only possible actions are "do nothing" and "do update". The "do > nothing" does not update the record, that is clear. But it also does not > return any data, and

how to return data from insert into ... on conflict ... returning ... into

2023-06-20 Thread Les
Consider this example drop table if exists tbl; drop sequence if exists seq; create sequence seq; create table tbl( id int8 not null primary key, d bytea not null, h bytea not null, -- hash of the data, calculated automatically dummy byte default 0 -- dummy value, see below... ); alter