Re: [Lazarus] Postgresql listen/notify
Marco van de Voort wrote: On Tue, May 08, 2012 at 08:01:45AM +, Mark Morgan Lloyd wrote: 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. 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.). -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Postgresql listen/notify
On Tue, May 08, 2012 at 08:01:45AM +, Mark Morgan Lloyd wrote: > 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. If it is table or row change notifications, MSSQL has it since iirc version 2005. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Postgresql listen/notify
On Tue, 8 May 2012, Mark Morgan Lloyd wrote: Leonardo M. Ramé wrote: Hi, 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.-- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Postgresql listen/notify
Leonardo M. Ramé wrote: Hi, 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. -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Postgresql listen/notify
On Tuesday 08 May 2012 01:04:06 Leonardo M. Ramé wrote: > Hi, 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 -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Postgresql listen/notify
Hi, does sql-db allows to capture PostgreSql notify events?. If yes, how?. Regards, -- Leonardo M. Ramé http://leonardorame.blogspot.com -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus