On Wed, Nov 3, 2021 at 2:18 PM Steve Baldwin <steve.baldwin@xxxxxxxxx> wrote: > I'm pretty sure the 'alias' for the '.. on conflict do update ..' needs to be 'excluded' (i.e. checks = excluded.checks, ...). Check the docs. That's right . The excluded.* pseudo-table isn't exactly the same thing as the target table -- it is a tuple that has the same "shape", that represents what the implementation tried (and failed) to insert into the table. I have to imagine that Alex wants to reference that, because that's the standard idiomatic approach with ON CONFLICT. And because the only alternative interpretation is that Alex intends to update those columns using their current values (not new values), which won't really change anything -- that seems unlikely to have been the intent. -- Peter Geoghegan