mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
pgindent run for 9.4
This includes removing tabs after periods in C comments, which was applied to back branches, so this change should not effect backpatching.
This commit is contained in:
@ -107,7 +107,7 @@ static void AfterTriggerSaveEvent(EState *estate, ResultRelInfo *relinfo,
|
||||
*
|
||||
* constraintOid, if nonzero, says that this trigger is being created
|
||||
* internally to implement that constraint. A suitable pg_depend entry will
|
||||
* be made to link the trigger to that constraint. constraintOid is zero when
|
||||
* be made to link the trigger to that constraint. constraintOid is zero when
|
||||
* executing a user-entered CREATE TRIGGER command. (For CREATE CONSTRAINT
|
||||
* TRIGGER, we build a pg_constraint entry internally.)
|
||||
*
|
||||
@ -418,7 +418,7 @@ CreateTrigger(CreateTrigStmt *stmt, const char *queryString,
|
||||
if (funcrettype != TRIGGEROID)
|
||||
{
|
||||
/*
|
||||
* We allow OPAQUE just so we can load old dump files. When we see a
|
||||
* We allow OPAQUE just so we can load old dump files. When we see a
|
||||
* trigger function declared OPAQUE, change it to TRIGGER.
|
||||
*/
|
||||
if (funcrettype == OPAQUEOID)
|
||||
@ -440,7 +440,7 @@ CreateTrigger(CreateTrigStmt *stmt, const char *queryString,
|
||||
* references one of the built-in RI_FKey trigger functions, assume it is
|
||||
* from a dump of a pre-7.3 foreign key constraint, and take steps to
|
||||
* convert this legacy representation into a regular foreign key
|
||||
* constraint. Ugly, but necessary for loading old dump files.
|
||||
* constraint. Ugly, but necessary for loading old dump files.
|
||||
*/
|
||||
if (stmt->isconstraint && !isInternal &&
|
||||
list_length(stmt->args) >= 6 &&
|
||||
@ -503,7 +503,7 @@ CreateTrigger(CreateTrigStmt *stmt, const char *queryString,
|
||||
|
||||
/*
|
||||
* If trigger is internally generated, modify the provided trigger name to
|
||||
* ensure uniqueness by appending the trigger OID. (Callers will usually
|
||||
* ensure uniqueness by appending the trigger OID. (Callers will usually
|
||||
* supply a simple constant trigger name in these cases.)
|
||||
*/
|
||||
if (isInternal)
|
||||
@ -627,7 +627,7 @@ CreateTrigger(CreateTrigStmt *stmt, const char *queryString,
|
||||
int16 attnum;
|
||||
int j;
|
||||
|
||||
/* Lookup column name. System columns are not allowed */
|
||||
/* Lookup column name. System columns are not allowed */
|
||||
attnum = attnameAttNum(rel, name, false);
|
||||
if (attnum == InvalidAttrNumber)
|
||||
ereport(ERROR,
|
||||
@ -732,7 +732,7 @@ CreateTrigger(CreateTrigStmt *stmt, const char *queryString,
|
||||
else
|
||||
{
|
||||
/*
|
||||
* User CREATE TRIGGER, so place dependencies. We make trigger be
|
||||
* User CREATE TRIGGER, so place dependencies. We make trigger be
|
||||
* auto-dropped if its relation is dropped or if the FK relation is
|
||||
* dropped. (Auto drop is compatible with our pre-7.3 behavior.)
|
||||
*/
|
||||
@ -801,7 +801,7 @@ CreateTrigger(CreateTrigStmt *stmt, const char *queryString,
|
||||
* full-fledged foreign key constraints.
|
||||
*
|
||||
* The conversion is complex because a pre-7.3 foreign key involved three
|
||||
* separate triggers, which were reported separately in dumps. While the
|
||||
* separate triggers, which were reported separately in dumps. While the
|
||||
* single trigger on the referencing table adds no new information, we need
|
||||
* to know the trigger functions of both of the triggers on the referenced
|
||||
* table to build the constraint declaration. Also, due to lack of proper
|
||||
@ -2038,7 +2038,7 @@ ExecBRInsertTriggers(EState *estate, ResultRelInfo *relinfo,
|
||||
if (newtuple != slottuple)
|
||||
{
|
||||
/*
|
||||
* Return the modified tuple using the es_trig_tuple_slot. We assume
|
||||
* Return the modified tuple using the es_trig_tuple_slot. We assume
|
||||
* the tuple was allocated in per-tuple memory context, and therefore
|
||||
* will go away by itself. The tuple table slot should not try to
|
||||
* clear it.
|
||||
@ -2113,7 +2113,7 @@ ExecIRInsertTriggers(EState *estate, ResultRelInfo *relinfo,
|
||||
if (newtuple != slottuple)
|
||||
{
|
||||
/*
|
||||
* Return the modified tuple using the es_trig_tuple_slot. We assume
|
||||
* Return the modified tuple using the es_trig_tuple_slot. We assume
|
||||
* the tuple was allocated in per-tuple memory context, and therefore
|
||||
* will go away by itself. The tuple table slot should not try to
|
||||
* clear it.
|
||||
@ -2503,7 +2503,7 @@ ExecBRUpdateTriggers(EState *estate, EPQState *epqstate,
|
||||
if (newtuple != slottuple)
|
||||
{
|
||||
/*
|
||||
* Return the modified tuple using the es_trig_tuple_slot. We assume
|
||||
* Return the modified tuple using the es_trig_tuple_slot. We assume
|
||||
* the tuple was allocated in per-tuple memory context, and therefore
|
||||
* will go away by itself. The tuple table slot should not try to
|
||||
* clear it.
|
||||
@ -2599,7 +2599,7 @@ ExecIRUpdateTriggers(EState *estate, ResultRelInfo *relinfo,
|
||||
if (newtuple != slottuple)
|
||||
{
|
||||
/*
|
||||
* Return the modified tuple using the es_trig_tuple_slot. We assume
|
||||
* Return the modified tuple using the es_trig_tuple_slot. We assume
|
||||
* the tuple was allocated in per-tuple memory context, and therefore
|
||||
* will go away by itself. The tuple table slot should not try to
|
||||
* clear it.
|
||||
@ -3031,7 +3031,7 @@ typedef SetConstraintStateData *SetConstraintState;
|
||||
* Although this is mutable state, we can keep it in AfterTriggerSharedData
|
||||
* because all instances of the same type of event in a given event list will
|
||||
* be fired at the same time, if they were queued between the same firing
|
||||
* cycles. So we need only ensure that ats_firing_id is zero when attaching
|
||||
* cycles. So we need only ensure that ats_firing_id is zero when attaching
|
||||
* a new event to an existing AfterTriggerSharedData record.
|
||||
*/
|
||||
typedef uint32 TriggerFlags;
|
||||
@ -3077,7 +3077,7 @@ typedef struct AfterTriggerEventDataOneCtid
|
||||
typedef struct AfterTriggerEventDataZeroCtids
|
||||
{
|
||||
TriggerFlags ate_flags; /* status bits and offset to shared data */
|
||||
} AfterTriggerEventDataZeroCtids;
|
||||
} AfterTriggerEventDataZeroCtids;
|
||||
|
||||
#define SizeofTriggerEvent(evt) \
|
||||
(((evt)->ate_flags & AFTER_TRIGGER_TUP_BITS) == AFTER_TRIGGER_2CTID ? \
|
||||
@ -3092,7 +3092,7 @@ typedef struct AfterTriggerEventDataZeroCtids
|
||||
/*
|
||||
* To avoid palloc overhead, we keep trigger events in arrays in successively-
|
||||
* larger chunks (a slightly more sophisticated version of an expansible
|
||||
* array). The space between CHUNK_DATA_START and freeptr is occupied by
|
||||
* array). The space between CHUNK_DATA_START and freeptr is occupied by
|
||||
* AfterTriggerEventData records; the space between endfree and endptr is
|
||||
* occupied by AfterTriggerSharedData records.
|
||||
*/
|
||||
@ -3134,7 +3134,7 @@ typedef struct AfterTriggerEventList
|
||||
*
|
||||
* firing_counter is incremented for each call of afterTriggerInvokeEvents.
|
||||
* We mark firable events with the current firing cycle's ID so that we can
|
||||
* tell which ones to work on. This ensures sane behavior if a trigger
|
||||
* tell which ones to work on. This ensures sane behavior if a trigger
|
||||
* function chooses to do SET CONSTRAINTS: the inner SET CONSTRAINTS will
|
||||
* only fire those events that weren't already scheduled for firing.
|
||||
*
|
||||
@ -3142,7 +3142,7 @@ typedef struct AfterTriggerEventList
|
||||
* This is saved and restored across failed subtransactions.
|
||||
*
|
||||
* events is the current list of deferred events. This is global across
|
||||
* all subtransactions of the current transaction. In a subtransaction
|
||||
* all subtransactions of the current transaction. In a subtransaction
|
||||
* abort, we know that the events added by the subtransaction are at the
|
||||
* end of the list, so it is relatively easy to discard them. The event
|
||||
* list chunks themselves are stored in event_cxt.
|
||||
@ -3174,12 +3174,12 @@ typedef struct AfterTriggerEventList
|
||||
* which we similarly use to clean up at subtransaction abort.
|
||||
*
|
||||
* firing_stack is a stack of copies of subtransaction-start-time
|
||||
* firing_counter. We use this to recognize which deferred triggers were
|
||||
* firing_counter. We use this to recognize which deferred triggers were
|
||||
* fired (or marked for firing) within an aborted subtransaction.
|
||||
*
|
||||
* We use GetCurrentTransactionNestLevel() to determine the correct array
|
||||
* index in these stacks. maxtransdepth is the number of allocated entries in
|
||||
* each stack. (By not keeping our own stack pointer, we can avoid trouble
|
||||
* each stack. (By not keeping our own stack pointer, we can avoid trouble
|
||||
* in cases where errors during subxact abort cause multiple invocations
|
||||
* of AfterTriggerEndSubXact() at the same nesting depth.)
|
||||
*/
|
||||
@ -3490,7 +3490,7 @@ afterTriggerRestoreEventList(AfterTriggerEventList *events,
|
||||
* single trigger function.
|
||||
*
|
||||
* Frequently, this will be fired many times in a row for triggers of
|
||||
* a single relation. Therefore, we cache the open relation and provide
|
||||
* a single relation. Therefore, we cache the open relation and provide
|
||||
* fmgr lookup cache space at the caller level. (For triggers fired at
|
||||
* the end of a query, we can even piggyback on the executor's state.)
|
||||
*
|
||||
@ -3566,6 +3566,7 @@ AfterTriggerExecute(AfterTriggerEvent event,
|
||||
}
|
||||
/* fall through */
|
||||
case AFTER_TRIGGER_FDW_REUSE:
|
||||
|
||||
/*
|
||||
* Using ExecMaterializeSlot() rather than ExecFetchSlotTuple()
|
||||
* ensures that tg_trigtuple does not reference tuplestore memory.
|
||||
@ -4093,7 +4094,7 @@ AfterTriggerFireDeferred(void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Run all the remaining triggers. Loop until they are all gone, in case
|
||||
* Run all the remaining triggers. Loop until they are all gone, in case
|
||||
* some trigger queues more for us to do.
|
||||
*/
|
||||
while (afterTriggerMarkEvents(events, NULL, false))
|
||||
@ -4156,7 +4157,7 @@ AfterTriggerBeginSubXact(void)
|
||||
int my_level = GetCurrentTransactionNestLevel();
|
||||
|
||||
/*
|
||||
* Ignore call if the transaction is in aborted state. (Probably
|
||||
* Ignore call if the transaction is in aborted state. (Probably
|
||||
* shouldn't happen?)
|
||||
*/
|
||||
if (afterTriggers == NULL)
|
||||
@ -4235,7 +4236,7 @@ AfterTriggerEndSubXact(bool isCommit)
|
||||
CommandId subxact_firing_id;
|
||||
|
||||
/*
|
||||
* Ignore call if the transaction is in aborted state. (Probably
|
||||
* Ignore call if the transaction is in aborted state. (Probably
|
||||
* unneeded)
|
||||
*/
|
||||
if (afterTriggers == NULL)
|
||||
@ -4378,7 +4379,7 @@ SetConstraintStateCopy(SetConstraintState origstate)
|
||||
}
|
||||
|
||||
/*
|
||||
* Add a per-trigger item to a SetConstraintState. Returns possibly-changed
|
||||
* Add a per-trigger item to a SetConstraintState. Returns possibly-changed
|
||||
* pointer to the state object (it will change if we have to repalloc).
|
||||
*/
|
||||
static SetConstraintState
|
||||
@ -4463,7 +4464,7 @@ AfterTriggerSetState(ConstraintsSetStmt *stmt)
|
||||
* First, identify all the named constraints and make a list of their
|
||||
* OIDs. Since, unlike the SQL spec, we allow multiple constraints of
|
||||
* the same name within a schema, the specifications are not
|
||||
* necessarily unique. Our strategy is to target all matching
|
||||
* necessarily unique. Our strategy is to target all matching
|
||||
* constraints within the first search-path schema that has any
|
||||
* matches, but disregard matches in schemas beyond the first match.
|
||||
* (This is a bit odd but it's the historical behavior.)
|
||||
@ -4489,7 +4490,7 @@ AfterTriggerSetState(ConstraintsSetStmt *stmt)
|
||||
|
||||
/*
|
||||
* If we're given the schema name with the constraint, look only
|
||||
* in that schema. If given a bare constraint name, use the
|
||||
* in that schema. If given a bare constraint name, use the
|
||||
* search path to find the first matching constraint.
|
||||
*/
|
||||
if (constraint->schemaname)
|
||||
@ -4593,7 +4594,7 @@ AfterTriggerSetState(ConstraintsSetStmt *stmt)
|
||||
|
||||
/*
|
||||
* Silently skip triggers that are marked as non-deferrable in
|
||||
* pg_trigger. This is not an error condition, since a
|
||||
* pg_trigger. This is not an error condition, since a
|
||||
* deferrable RI constraint may have some non-deferrable
|
||||
* actions.
|
||||
*/
|
||||
@ -4664,7 +4665,7 @@ AfterTriggerSetState(ConstraintsSetStmt *stmt)
|
||||
|
||||
/*
|
||||
* Make sure a snapshot has been established in case trigger
|
||||
* functions need one. Note that we avoid setting a snapshot if
|
||||
* functions need one. Note that we avoid setting a snapshot if
|
||||
* we don't find at least one trigger that has to be fired now.
|
||||
* This is so that BEGIN; SET CONSTRAINTS ...; SET TRANSACTION
|
||||
* ISOLATION LEVEL SERIALIZABLE; ... works properly. (If we are
|
||||
@ -4724,7 +4725,7 @@ AfterTriggerPendingOnRel(Oid relid)
|
||||
AfterTriggerShared evtshared = GetTriggerSharedData(event);
|
||||
|
||||
/*
|
||||
* We can ignore completed events. (Even if a DONE flag is rolled
|
||||
* We can ignore completed events. (Even if a DONE flag is rolled
|
||||
* back by subxact abort, it's OK because the effects of the TRUNCATE
|
||||
* or whatever must get rolled back too.)
|
||||
*/
|
||||
@ -4765,7 +4766,7 @@ AfterTriggerPendingOnRel(Oid relid)
|
||||
* be fired for an event.
|
||||
*
|
||||
* NOTE: this is called whenever there are any triggers associated with
|
||||
* the event (even if they are disabled). This function decides which
|
||||
* the event (even if they are disabled). This function decides which
|
||||
* triggers actually need to be queued.
|
||||
* ----------
|
||||
*/
|
||||
|
Reference in New Issue
Block a user