Re: [HACKERS] pg_shmem_allocations view

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Marti Raudsepp <marti(at)juffo(dot)org>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] pg_shmem_allocations view
Date: 2019-12-18 15:36:52
Message-ID: CA+Tgmobtv_vBJhuEOWevJ77GazMkhG+YzbNoavRRWZFXUMkwbg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 15, 2019 at 2:59 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> I didn't really read the patch in any detail, but those things
> hopped out at me.

Thanks for the reviews. Here is a new version. Changes:

- doc: Add an entry to the table of system views, per Tom.
- doc: Wrap reference to "<anonymous>" in <literal> tags, per self-review.
- doc: Note that off is NULL for <anonymous> allocations, per Andres.
- doc: Remove extra "or" at the end of a sentence, per self-review.
- doc: Note that the view is by default super-user only, per both Tom
and Andres.
- code: Declare values/nulls arrays only once at function scope
instead of 3x, and tighten up code, per Andres and self-review.
- dat: Mark as volatile, per Tom and Andres and Michael.

Non-changes:

- I didn't add a comment saying that there would be only one entry for
anonymous and free memory, as requested by Andres, because it seemed
like that's what users would expect anyway and I couldn't think of a
way of saying it that didn't sound dumb.
- I didn't expand the comment for the C function
pg_get_shmem_allocations, as requested by Michael, because I agree
with Andres that there doesn't seem to be anything particularly
helpful to say there.

I'll go ahead and commit this if nobody has further comments.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment Content-Type Size
v2-0001-Add-a-pg_shmem_allocations-view.patch application/octet-stream 9.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2019-12-18 15:44:02 Re: Windows port minor fixes
Previous Message Stephen Frost 2019-12-18 15:24:56 Re: Allow cluster owner to bypass authentication