#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2012
    Posts
    2
    Rep Power
    0

    Trigger (or something similar) on CREATE TABLE?


    Hello,

    I am new to PostgreSQL, but have a bit of experience with MySQL.

    I would like to create a trigger on the CREATE TABLE function, such that every time a SQL user wants to create a table in my database, a "hidden" column is automatically added to that table.

    I know I can create triggers for INSERT/ UPDATE/ DELETE. My question is, is there a way to create one on the CREATE TABLE function, or a way to modify the function so it calls a function of my own?

    Thank you.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,788
    Rep Power
    349
    Originally Posted by kjb7
    My question is, is there a way to create one on the CREATE TABLE function
    No, PostgreSQL does not have DDL triggers.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2012
    Posts
    2
    Rep Power
    0
    Is there an alternative action I could take that would have the same, or a similar, effect?

IMN logo majestic logo threadwatch logo seochat tools logo