pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Bill Parker <wp02855@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Subject: Re: Lack of Sanity Checking in file 'pctcl.c' for PostgreSQL 9.4.x
Date: Mon, 20 Jul 2015 14:29:28 +0200
Message-ID: <20150720122928.GM2301@postgresql.org> (raw)
In-Reply-To: <CAB7nPqTSwmSeEFAGpWMbq5qkRXfDKm-pcPqPe3x_Xj+=RG9kEQ@mail.gmail.com>
References: <CAFrbyQwyLDYXfBOhPfoBGqnvuZO_Y90YgqFM11T2jvnxjLFmqw@mail.gmail.com>
	<CAB7nPqRmXz2DymNd_BX8HkaRJuQCTUyhh2d5Zx+d0aHNvpTw0Q@mail.gmail.com>
	<20150612194716.GQ133018@postgresql.org>
	<4457.1434166911@sss.pgh.pa.us>
	<CAB7nPqSE2vmAdrv0LWBKkM-uBntscU6vdRRhUmKTOwjLNhJ7Lg@mail.gmail.com>
	<20150718155421.GZ2301@postgresql.org>
	<20150718201915.GA2297@postgresql.org>
	<CAB7nPqTSwmSeEFAGpWMbq5qkRXfDKm-pcPqPe3x_Xj+=RG9kEQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Michael Paquier wrote:

> > With some additional effort, we could get rid of perm_fmgr_info, at
> > least in pltcl.  (That hack was introduced in a3ed622b63b and
> > 7748e9e7e5a back in 2001 and we never actually fixed it ...)
> 
> Yes it seems so, even for plperl and plpython there seem to be some
> room for improvement at quick glance... This looks like a master-only
> change to me though (and I am sure we are on the same page). For
> back-branches something like the previous patch is definitely safer.

Pushed.

All in all, the whole business of memory allocation in pltcl is pretty
nasty.  If people is really interested in pltcl, that should probably be
fixed to avoid memory leaks.  For one thing, the query cache hash is
global to the interpreter, not local to the function; whenever a
function is recompiled, the old SPI_prepared plans linger forever in the
interpreter (for the life of the session).  It would be nicer if those
were tied to the function lifetime.  For this, the hashtable would have
to be moved to the query desc struct.  pltcl_spi_prepare would have to
know the currently executing function desc struct ...

Maybe Bill is interested enough to write a patch?

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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (11+ messages)  latest in thread

Message-ID: <20150720122928.GM2301@postgresql.org>
Permalink:  ../20150720122928.GM2301@postgresql.org/
Also on:    postgresql.org/message-id/20150720122928.GM2301@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: alvherre@2ndquadrant.com, michael.paquier@gmail.com, tgl@sss.pgh.pa.us, wp02855@gmail.com
  Subject: Re: Lack of Sanity Checking in file 'pctcl.c' for PostgreSQL 9.4.x
  In-Reply-To: <20150720122928.GM2301@postgresql.org>
  References: <CAFrbyQwyLDYXfBOhPfoBGqnvuZO_Y90YgqFM11T2jvnxjLFmqw@mail.gmail.com> <CAB7nPqRmXz2DymNd_BX8HkaRJuQCTUyhh2d5Zx+d0aHNvpTw0Q@mail.gmail.com> <20150612194716.GQ133018@postgresql.org> <4457.1434166911@sss.pgh.pa.us> <CAB7nPqSE2vmAdrv0LWBKkM-uBntscU6vdRRhUmKTOwjLNhJ7Lg@mail.gmail.com> <20150718155421.GZ2301@postgresql.org> <20150718201915.GA2297@postgresql.org> <CAB7nPqTSwmSeEFAGpWMbq5qkRXfDKm-pcPqPe3x_Xj+=RG9kEQ@mail.gmail.com> <20150720122928.GM2301@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox