postgresql triggers to update GUI?

Bengt Richter bokr at accessone.com
Mon Nov 26 16:20:19 EST 2001


On Mon, 26 Nov 2001 15:28:26 -0500, "Steve Holden" <sholden at holdenweb.com> wrote:

>"Robert Nikander" <nikander at mindspring.com> wrote ...
>> Hi,
>>
>> 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...
>
Seems like someone must have invented a trigger process with a side effect
of sending a message to a subscriber list, so that a GUI could have a thread
that has subscribed and is listening for a message. The message wouldn't have
to contain the data. That could be aquired by new DB query.




More information about the Python-list mailing list