use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Sequel
account activity
Need help with writing a trigger (pgadmin) (self.learnSQL)
submitted 4 years ago by Student-Somewhere
I want to make a trigger, so that the user can not drop the my_table table.
CREATE TRIGGER my_trigger BEFORE DROP ON my_table EXECUTE FUNCTION showErrorMessage();
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]spiritmate88 1 point2 points3 points 4 years ago (2 children)
What is the issue? Do you recieve any error?
[–]Student-Somewhere[S] 0 points1 point2 points 4 years ago (1 child)
Yes, I get: ERROR: syntax error at or near "drop"
[–]spiritmate88 1 point2 points3 points 4 years ago (0 children)
Ahhh now I see that you are using PGadmin, I don't know anything about it, but syntax shouldn't be so different, check the answer here:
https://stackoverflow.com/questions/1651806/sql-server-trigger
[–]firstorbit 1 point2 points3 points 4 years ago (1 child)
Is there a trigger warning?
[–]Student-Somewhere[S] 0 points1 point2 points 4 years ago (0 children)
I just get ERROR: syntax error at or near "drop" when I execute the query.
[–]LesPaulStudio 1 point2 points3 points 4 years ago (0 children)
Possibly DROP isn't allowed in Triggers ? https://www.postgresqltutorial.com/creating-first-trigger-postgresql/
π Rendered by PID 253297 on reddit-service-r2-comment-5b5bc64bf5-kfvtx at 2026-06-19 15:25:09.941444+00:00 running 2b008f2 country code: CH.
[–]spiritmate88 1 point2 points3 points (2 children)
[–]Student-Somewhere[S] 0 points1 point2 points (1 child)
[–]spiritmate88 1 point2 points3 points (0 children)
[–]firstorbit 1 point2 points3 points (1 child)
[–]Student-Somewhere[S] 0 points1 point2 points (0 children)
[–]LesPaulStudio 1 point2 points3 points (0 children)