Re: pg_shmem_allocations view

Andres Freund <andres@2ndquadrant.com>

From: Andres Freund <andres@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>, Marti Raudsepp <marti@juffo.org>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2014-08-18T16:37:18Z
Lists: pgsql-hackers
On 2014-08-18 12:33:44 -0400, Tom Lane wrote:
> Andres Freund <andres@2ndquadrant.com> writes:
> > On 2014-08-18 12:27:12 -0400, Tom Lane wrote:
> >> Should we consider putting it into an extension rather than having
> >> it in the core system?  That would offer some additional protection
> >> for production systems, which really shouldn't have much need for
> >> this IMO.
> 
> > I'd considered that somewhere upthread and decided that it'd require
> > exposing to much internals from shmem.c/dsm.c without a corresponding
> > benefit.
> 
> Well, we could have the implementation code in those modules but not
> provide any SQL-level access to it without installing an extension.
> The only extra thing visible in the .h files would be a function or two.

That'd require wrapper functions in the extension afaics. Not that that
is prohibitive, but a bit inconvenient. At least I don't see another way
to create a sql function referring to a builtin C implementation. I
don't think PG_FUNCTION_INFO_V1() can reliably made work. We could have
the underlying function in pg_proc, but not create the view...

Greetings,

Andres Freund

-- 
 Andres Freund	                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


Commits

  1. Add pg_shmem_allocations view.