How to use LISTEN/NOTIFY with the UniDAC PostgreSQL provider

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

How to use LISTEN/NOTIFY with the UniDAC PostgreSQL provider

Post by swierzbicki » Wed 28 Dec 2011 22:20

Hello,

How to use LISTEN/NOTIFY with the UniDAC PostgreSQL provider ?
Can you please share any exemples ?

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Thu 29 Dec 2011 11:06

Hello

For sending and getting notification, you should use TUniAlerter:

Getting:

Code: Select all

begin
  UniAlerter1.Events := 'pg_uni_alerter'; // any name
  UniAlerter1.Start;
end;
Sending:

Code: Select all

begin
  // second parameter is supported in PostgreSQL 9.0 and higher
  UniAlerter1.SendEvent('pg_uni_alerter', 'message'); 
end;

Post Reply