Re: Nested transactions: deferred triggers - Mailing list pgsql-patches

From Tom Lane
Subject Re: Nested transactions: deferred triggers
Date
Msg-id 23372.1055361236@sss.pgh.pa.us
Whole thread Raw
In response to Nested transactions: deferred triggers  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Responses Re: Nested transactions: deferred triggers  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
List pgsql-patches
Alvaro Herrera <alvherre@dcc.uchile.cl> writes:
> In an attempt to simplify my life I'm submitting this patch that
> restructures the deferred trigger queue.  The fundamental change is to
> put all the static variables to hold the deferred triggers in a single
> structure.

Seems reasonable, but I have a stylistic gripe:

> + static DeferredTriggers    ts;

I dislike static variables with names as short as that --- they are too
likely to conflict against local variables.  (And before you say there's
no problem because a local declaration would mask it, what happens if
you forget the local declaration?)

I suspect you named it this way because you intend to pass it as a
parameter to all these routines later, and you're trying to avoid
one pass of editing when you add "DeferredTriggers ts"  to the parameter
lists.  I would suggest doing that now and including it in the patch.
Whether you are intending that or not, please use a better name for
the static variable.

            regards, tom lane

pgsql-patches by date:

Previous
From: Alvaro Herrera
Date:
Subject: Nested transactions: deferred triggers
Next
From: Kurt Roeckx
Date:
Subject: Re: Ipv6 network cleanup patch #2.