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

From Andrew Tipton
Subject Re: [PATCH] SQL assertions prototype
Date
Msg-id CA+M2pVVT3_szvtkMKR-ViA1r4Xo5C-0URuGwL8BN47KmS-5Exg@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] SQL assertions prototype  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: [PATCH] SQL assertions prototype  (Kevin Grittner <kgrittn@ymail.com>)
List pgsql-hackers
On Sun, Nov 24, 2013 at 11:03 PM, Simon Riggs <simon@2ndquadrant.com> 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.

That sounds very similar to handling incremental maintenance of
materialized views, which Kevin is working on.

Let's assume that the "huge SQL command that re-checks every row of
the table" is actually a materialized view.  In that case, the CREATE
ASSERTION trigger would merely need to scan the matview and raise an
error if any rows were present.  That should be a very quick
operation.  No need to invent some sort of "get access to the changed
rows" mechanism especially for CREATE ASSERTION.


Kind regards,
Andrew Tipton



pgsql-hackers by date:

Previous
From: Rodolfo Campero
Date:
Subject: Re: PL/Python: domain over array support
Next
From: Andrew Tipton
Date:
Subject: Re: Add CREATE support to event triggers