Re: [PATCH] SQL assertions prototype - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [PATCH] SQL assertions prototype
Date
Msg-id 5294EB88.50802@gmx.net
Whole thread Raw
In response to Re: [PATCH] SQL assertions prototype  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
On 11/24/13, 10:03 AM, Simon Riggs wrote:
> So we'd need to get access to the changed rows, rather than
> re-executing a huge SQL command that re-checks every row of the table.
> That last point will make it unusable for sensible amounts of data.

SQL assertions work with arbitrary expressions.  So even if you had the
changed rows, you couldn't do anything with them in general.  For cases
where it makes sense to consider the changed rows, you probably want a
per-table trigger or an exclusion constraint or perhaps an auto-updated
materialized view.  Then again, we have lots of ways to make queries
fast even for large tables.




pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Cleaner build output when not much has changed
Next
From: Andrew Dunstan
Date:
Subject: Re: pre-commit triggers