Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
6115480c
Commit
6115480c
authored
Mar 23, 2014
by
Noah Misch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve comments about AfterTriggerBeginQuery() query level usage.
parent
c31305de
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
src/backend/commands/trigger.c
src/backend/commands/trigger.c
+11
-5
No files found.
src/backend/commands/trigger.c
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
])
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment