Hi, does sql-db allows to capture PostgreSql notify events?. If yes, how?.
Regards,

Mailing lists / lazarus / 2012-05
6 messages · 5 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hi, does sql-db allows to capture PostgreSql notify events?. If yes, how?.
Regards,
Leonardo M. Ram? wroteHi, does sql-db allows to capture PostgreSql notify events?. If yes, how?.
MSEgui fork of sqldb has tdbevent component, see lib/db/msedbevents.pas.
Martin
Hi, does sql-db allows to capture PostgreSql notify events?. If yes, how?. Leonardo M.…
Leonardo M. Ram? wroteHi, does sql-db allows to capture PostgreSql notify events?. If yes, how?.
Indirectly. You have to set it up using the TPQConnection.Handle since this has long-term persistence, and have to make direct API calls *not* ExecuteDirect() since that uses a temporary handle. It works, but is sensitive to transient network failures etc.: the server end can forget, so it's wise to have a fallback mechanism.
I don't know whether it should be treated as a candidate for an extension to the sql-db API, since as far as I know there's something comparable (implemented very differently) on Firebird but nothing else.
Well, that and a backup/restore API for those engines supporting it.
Michael.
Indirectly. You have to set it up using the TPQConnection.Handle since this has long-term…
Mark Morgan Lloyd wroteI don't know whether it should be treated as a candidate for an extension to the sql-db API, since as far as I know there's something comparable (implemented very differently) on Firebird but nothing else.
If it is table or row change notifications, MSSQL has it since iirc version 2005.
It's not, PostgreSQL would probably call those triggers. It's a general notification mechanism which can be used between programs connected to the same database irrespective of what they're doing with tables, see http://www.postgresql.org/docs/8.2/static/sql-notify.html (I've intentionally referenced a fairly old version there, since recent changes have added an additional parameter etc.).