1) i want to know the channels name which are listing on my database but pg_listening_channels() name always returning null value (blank) even some clients are listening on this database.
below is my pgsql code. is any thing wrong in this code.
CREATE OR REPLACE FUNCTION query_trigger()
RETURNS trigger AS
$BODY$
DECLARE
send_message text;
queryString text;
channelNameArray text[];
channelNames text;
BEGIN
queryString = current_query();
channelNameArray = pg_listening_channels();
channelNames = array_to_string(channelNameArray , ',');
send_message := queryString || ' ' || channelNames;
insert into "Client_Address" values (channelNames , queryString) ;
PERFORM pg_notify('myChannel', send_message );
RETURN NULL;
END;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
ALTER FUNCTION query_trigger() OWNER TO postgres;
Schema of Client_Address table
Notify_node text;
query text;