Search Postgresql Archives

Re: How can a Postgres SQL script be automatically run when a new table turns up?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 13, 2022 at 8:55 AM Shaozhong SHI <shishaozhong@xxxxxxxxx> wrote:
That looks interesting.  Is there an excellent example to do the following?

 How to create an event trigger in Postgres? When a user finished loading a new table on to it, the trigger can start off an script 10 minutes after the event?


IIUC when an event trigger executes it prevents the DLL (create table in this example) from committing - so the only thing the event trigger can meaningfully do is write a record to the database that tells some other piece of software to do something 10 minutes from now.  You could have a script execute every minute (say via cron) looking for such a record and when it finds one, and the time is right, it would do its thing.  Otherwise it would just stop.

David J.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux