Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
6115480c
Commit
6115480c
authored
11 years ago
by
Noah Misch
Browse files
Options
Downloads
Patches
Plain Diff
Improve comments about AfterTriggerBeginQuery() query level usage.
parent
c31305de
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/backend/commands/trigger.c
+11
-5
11 additions, 5 deletions
src/backend/commands/trigger.c
with
11 additions
and
5 deletions
src/backend/commands/trigger.c
+
11
−
5
View file @
6115480c
...
...
@@ -3805,10 +3805,14 @@ AfterTriggerEndQuery(EState *estate)
* IMMEDIATE: all events we have decided to defer will be available for it
* to fire.
*
* We loop in case a trigger queues more events at the same query level
* (is that even possible?). Be careful here: firing a trigger could
* result in query_stack being repalloc'd, so we can't save its address
* across afterTriggerInvokeEvents calls.
* We loop in case a trigger queues more events at the same query level.
* Ordinary trigger functions, including all PL/pgSQL trigger functions,
* will instead fire any triggers in a dedicated query level. Foreign key
* enforcement triggers do add to the current query level, thanks to their
* passing fire_triggers = false to SPI_execute_snapshot(). Other
* C-language triggers might do likewise. Be careful here: firing a
* trigger could result in query_stack being repalloc'd, so we can't save
* its address across afterTriggerInvokeEvents calls.
*
* If we find no firable events, we don't have to increment
* firing_counter.
...
...
@@ -4046,7 +4050,9 @@ AfterTriggerEndSubXact(bool isCommit)
/*
* Release any event lists from queries being aborted, and restore
* query_depth to its pre-subxact value.
* query_depth to its pre-subxact value. This assumes that a
* subtransaction will not add events to query levels started in a
* earlier transaction state.
*/
while
(
afterTriggers
->
query_depth
>
afterTriggers
->
depth_stack
[
my_level
])
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment