Re: using worker_spi as pattern

From: Jeremy Finzel <finzelj(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: using worker_spi as pattern
Date: 2018-03-09 21:03:51
Message-ID: CAMa1XUhGWykBEs+566_XcyeZd93S=0+Kc5nsg0C6+jE=_VBbtg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 9, 2018 at 12:34 AM, Michael Paquier <michael(at)paquier(dot)xyz>
wrote:

> On Thu, Mar 08, 2018 at 11:04:20PM -0600, Jeremy Finzel wrote:
> > Since you mention, can anyone elaborate further on the memory leak danger
> > here?
> >
> > Line 193 in src/test/modules/worker_spi/worker_spi.c read:
> > # Note some memory might be leaked here.
> >
> > Is this any reason *not *to use this pattern in production?
>
> quote_identifier may palloc the result, so the first pstrdup on the top
> to save "schema" and "table" refer to a pointer which may perhaps get
> lost. Those are just a couple of bytes, so the code complication is not
> worth the cleanup IMO.
> --
> Michael
>

Makes sense, thank you.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-03-09 21:05:14 Re: FOR EACH ROW triggers on partitioned tables
Previous Message Andres Freund 2018-03-09 20:56:18 Re: JIT compiling with LLVM v11