Re: row filtering for logical replication

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Euler Taveira <euler(at)timbira(dot)com(dot)br>
Cc: Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Suzuki Hironobu <hironobu(at)interdb(dot)jp>
Subject: Re: row filtering for logical replication
Date: 2018-11-23 16:19:33
Message-ID: 20181123161933.jpepibtyayflz2xg@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018-Nov-23, Euler Taveira wrote:

> Em qui, 22 de nov de 2018 às 20:03, Petr Jelinek
> <petr(dot)jelinek(at)2ndquadrant(dot)com> escreveu:

> > Won't this leak memory? The list_free only frees the list cells, but not
> > the nodes you stored there before.
>
> Good catch. It should be list_free_deep.

Actually, if the nodes have more structure (say you palloc one list
item, but that list item also contains pointers to a Node) then a
list_free_deep won't be enough either. I'd suggest to create a bespoke
memory context, which you can delete afterwards.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-11-23 16:25:12 Re: Inadequate executor locking of indexes
Previous Message Euler Taveira 2018-11-23 16:15:08 Re: row filtering for logical replication