1)我想知道在我的数据库中列出的频道名称,但 pg_listening_channels() 名称总是返回空值(空白),即使某些客户端正在侦听此数据库。
下面是我的 pgsql 代码。这段代码有什么问题吗?
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;