On Tue, Jun 03, 2025 at 10:39:25PM +0300, Florents Tselai wrote:
> Thanks for the detailed review Nathan

Thanks for the updated patch!

+    if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo))
+        ereport(ERROR, (errmsg("pg_get_dsm_registry_allocations must be used 
in a SRF context")));

InitMaterializedSRF() takes care of this for you.

+typedef struct
+{
+    Tuplestorestate *tupstore;
+    TupleDesc        tupdesc;
+} DSMRegistrySRFContext;

This appears to be unused.

+#include "fmgr.h"
+#include "funcapi.h"
+#include "miscadmin.h"
+#include "utils/builtins.h"

Do we need fmgr.h and miscadmin.h?  Also, please alphabetize these into the
existing list of #includes.

+        values[1] = Int64GetDatum(entry->size);

I think there's a sign mismatch problem here, but it seems implausible in
practice.  pg_get_shmem_allocations() does the same thing.

+ <sect1 id="view-pg-dsm-registry-allocations">
+  <title><structname>pg_dsm_registry_allocations</structname></title>

We need to add an entry into the System Views table in the Overview page,
too.

-- 
nathan


Reply via email to