Trigger when a stored procedure is called #2056
-
As far as I know, triggers are fired only when there are changes to a table, however, I was wondering if there was a way to fire a trigger when another procedure is called. I am trying to implement page visit counts for each webpage that I have, however, I do not need the visit count immediately as soon as I visit the page, hence, I didn't opt to just run an incremental query whenever the page is loaded. I instead want to run a trigger that adds to the page visit count whenever I run a stored procedure of retrieving the webpage data. Is this in any way possible? If not, are there any better solutions? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Did you look into the pre-request hook that PostgREST provides? Maybe that could help: https://postgrest.org/en/v9.0/configuration.html#pre-request |
Beta Was this translation helpful? Give feedback.
Did you look into the pre-request hook that PostgREST provides?
Maybe that could help: https://postgrest.org/en/v9.0/configuration.html#pre-request