On 01/20/2015 10:08 AM, Noah Misch wrote:
> Fair enough. It did reinforce pg_get_constraintdef() as a subroutine of
> pg_dump rather than an independent, rigorous interface. It perhaps made the
> function worse for non-pg_dump callers. In that vein, each one of these hacks
> has a cost. One could make a reasonable argument that ALTER TRIGGER RENAME
> locking is not important enough to justify spreading the hack from
> pg_get_constraintdef() to pg_get_triggerdef(). Lowering the CREATE TRIGGER
> lock level does not require any ruleutils.c change for the benefit of pg_dump,
> because pg_dump won't see the pg_trigger row of a too-recent trigger.
I agree with this view, and am not sure myself that it is worth lowering
the lock level of ALTER TRIGGER RENAME. I have attached a patch without
the changes to ALTER TRIGGER and ruleutils.c and also fixes the comment
issues noted by Andres.
--
Andreas Karlsson