From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | Shaozhong SHI <shishaozhong(at)gmail(dot)com> |
Cc: | Jayadevan M <maymala(dot)jayadevan(at)gmail(dot)com>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org> |
Subject: | Re: How can a Postgres SQL script be automatically run when a new table turns up? |
Date: | 2022-01-14 00:31:49 |
Message-ID: | CAKFQuwajqp8PRuxWu=RQsYbh3zq+txV9hCNJpu3Y81Qhmi-z0A@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Thu, Jan 13, 2022 at 8:55 AM Shaozhong SHI <shishaozhong(at)gmail(dot)com>
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.
From | Date | Subject | |
---|---|---|---|
Next Message | Zwettler Markus (OIZ) | 2022-01-14 09:01:12 | AW: [Extern] Re: postgres event trigger workaround |
Previous Message | Tom Lane | 2022-01-13 23:35:55 | Re: Assistance with an out of shared memory error |