postgresql triggers to update GUI?
Brian E Gallew
geek+ at andrew.cmu.edu
Mon Nov 26 21:49:49 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?
What you are looking for are asynchronous requests. Basically, you
make an async request, then in your GUI mainloop you peridically check
to see if you got any results (updating the GUI if necessary). There
is no way to make a database trigger talk to your GUI UNLESS you are
willing to open up a socket in the GUI, listen/process requests on it
and have your database trigger write to that socket (don't forget to
have error handling in there so that it doesn't crash when there's no
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 266 bytes
Desc: not available
More information about the Python-list