Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

execute a trigger when I create a table

I would like to know if a trigger on a system table of PostgreSQL can be executed when I create a table

I need to add 2 functions on each table of my database and I would like to do it dynamically

Thanks

like image 846
Julien Avatar asked Mar 23 '12 13:03

Julien


People also ask

Can a trigger be created on a table?

To create a trigger in your own schema on a table in your own schema or on your own schema ( SCHEMA ), you must have the CREATE TRIGGER system privilege. To create a trigger in any schema on a table in any schema, or on another user's schema ( schema . SCHEMA ), you must have the CREATE ANY TRIGGER system privilege.

How do you make a trigger on a table?

Finding triggers on a table. It is easy to find triggers created against a table. All you have to do is Expand the table in the SSMS or Azure Data Studio's left panel and then expand the Triggers folder.


1 Answers

I know it's an old question but now it has been implemented in version 9.3, or at least partially http://www.postgresql.org/docs/9.3/static/event-trigger-definition.html

like image 112
Ali Avatar answered Oct 05 '22 01:10

Ali