Table refer leak in logical replication - Mailing list pgsql-hackers

From tanghy.fnst@fujitsu.com
Subject Table refer leak in logical replication
Date
Msg-id OS0PR01MB611383FA0FE92EB9DE21946AFB769@OS0PR01MB6113.jpnprd01.prod.outlook.com
Whole thread Raw
Responses RE: Table refer leak in logical replication
List pgsql-hackers
Hi

I met a problem about trigger in logical replication.

I created a trigger after inserting data at subscriber, but there is a warning in the log of subscriber when the
triggerfired: 
WARNING: relcache reference leak: relation "xxx" not closed.

Example of the procedure:
------publisher------
create table test (a int primary key);
create publication pub for table test;

------subscriber------
create table test (a int primary key);
create subscription sub connection 'dbname=postgres' publication pub;
create function funcA() returns trigger as $$ begin return null; end; $$ language plpgsql;
create trigger my_trig after insert or update or delete on test for each row execute procedure funcA();
alter table test enable replica trigger my_trig;

------publisher------
insert into test values (6);

It seems an issue about reference leak. Anyone can fix this?

Regards,
Tang



pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Stronger safeguard for archive recovery not to miss data
Next
From: "houzj.fnst@fujitsu.com"
Date:
Subject: RE: Table refer leak in logical replication