Re: CREATE ASSERTION: database level assertions feature

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marcos Magueta <maguetamarcos(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: CREATE ASSERTION: database level assertions feature
Date: 2026-02-15 01:33:42
Message-ID: 812111.1771119222@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Marcos Magueta <maguetamarcos(at)gmail(dot)com> writes:
> I would be willing to at least get started with a patch for this, but
> before that, I want to assess the interest and thoughts on how to properly
> implement it.

Everyone who has looked at that has run away screaming. The
consequences for performance, complexity, deadlock potential,
etc are all horrible. There are also fun questions about
appropriate permissions. As the spec is written, it appears
that anyone with read permission on a table can block updates
on that table (by creating an assertion that attempted updates
will fail).

> FWIW, this is part of the SQL Standard: ISO/IEC 9075-2:2023, 11.47:

Yup. We are not obligated to implement everything in the
standard.

> If there's already a thread on the issue, forgive me, but I couldn't find
> it in the archives.

It's been discussed, though not recently.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2026-02-15 02:04:22 Re: index prefetching
Previous Message Alexander Korotkov 2026-02-15 01:22:43 Re: MERGE behavior with REPEATABLE READ isolation level