Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ability to access to transition tables #123

Closed
gagalago opened this issue May 24, 2024 · 1 comment · Fixed by #125
Closed

ability to access to transition tables #123

gagalago opened this issue May 24, 2024 · 1 comment · Fixed by #125

Comments

@gagalago
Copy link
Contributor

transition tables allow to access to all lines changed. it's especialy usefull for statement trigger to be able to apply in the function only what is really needed.

from the postgres documentation (last paragraph):

By default, statement-level triggers do not have any way to examine the individual row(s) modified by the statement. But an AFTER STATEMENT trigger can request that transition tables be created to make the sets of affected rows available to the trigger. AFTER ROW triggers can also request transition tables, so that they can see the total changes in the table as well as the change in the individual row they are currently being fired for. The method for examining the transition tables again depends on the programming language that is being used, but the typical approach is to make the transition tables act like read-only temporary tables that can be accessed by SQL commands issued within the trigger function.

and the syntax of it's definition

do you think it's something that can be integrated into this gem? if yes, how do you see this addition, what need to be changed to be compatible?

@gagalago
Copy link
Contributor Author

@jenseng what do you think about this? you can also check the associated pull request

jenseng added a commit that referenced this issue Sep 4, 2024
#125)

fix: #123

add ability to access to transition tables. that allow to know which
rows changed, this is especially useful when using statement triggers

Co-authored-by: Jon Jensen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant