postgresql triggers to update GUI?
sholden at holdenweb.com
Mon Nov 26 21:28:26 CET 2001
"Robert Nikander" <nikander at mindspring.com> wrote ...
> I am writing a python program that uses a postgresql db backend. I would
> like to update the gui whenever a change in certain tables occurs, so it
> would be nice to use triggers rather than generating the 'events' when I
> update the db. That way I get cascading changes. Does anyone know of a
> python module that supports postresql triggers? ie: you can create a
> trigger that calls a python function? Is there another solution here
> that I am missing?
The purpose of a trigeer is to maintain the database's semantic integrity by
running stored procedures whenever particular changes take place. Because
triggers are specifically stored procedures, they run within the database
engine rather than inside a database client process. It therefore wouldn't
seem like a suitable mechanism for triggering updates of a GUI. Sorry...
Perhaps what you need is an update process that both the standard database
clients and your GUI-based monitor process communicate with?
More information about the Python-list