Re: pre-commit triggers - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: pre-commit triggers
Date
Msg-id m2fvqss3ne.fsf@2ndQuadrant.fr
Whole thread Raw
In response to Re: pre-commit triggers  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> Perhaps my understanding of when XIDs are acquired is insufficient. When
> exactly is it optional?

My understanding of Noah's comment is that we would be exposing what
used to be an optimisation only implementation detail to the user, and
so we would need to properly document the current situation and would
probably be forbidden to change it in the future.

Then I guess it's back to the use cases: do we have use cases where it
would be interesting for the pre-commit trigger to only get fired when
an XID has been consumed?

I don't think so, because IIRC CREATE TEMP TABLE will consume an XID
even in an otherwise read-only transaction, and maybe the TEMP TABLE
writes will not be considered "actual writes" by the confused user.

What about specifying what notion of "data modifying" transactions
you're interested into and providing an SQL callable C function that the
trigger user might then use, or even a new WHEN clause?

Regards,
-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support



pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: additional json functionality
Next
From: Robert Haas
Date:
Subject: Re: additional json functionality