public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Corey Huinker <[email protected]>
Cc: [email protected]
Cc: [email protected]
Subject: Re: Add starelid, attnum to pg_stats and leverage this in pg_dump
Date: Thu, 26 Feb 2026 15:36:07 -0500
Message-ID: <[email protected]> (raw)
In-Reply-To: <CADkLM=coCVy92QkVUUTLdo5eO2bMDtwMrzRn_8miAhX+uPaqXg@mail.gmail.com>
References: <CADkLM=coCVy92QkVUUTLdo5eO2bMDtwMrzRn_8miAhX+uPaqXg@mail.gmail.com>

Corey Huinker <[email protected]> writes:
> Per side conversation in [1], this patch exposes pg_statistic.starelid in
> the pg_stats view (0001) and then changes pg_dump to use the starelid in
> the queries on pg_stats rather than the combination of schemaname+relname,

I don't object to the idea, but I don't like exposing the name
"starelid".  That just screams implementation artifact, and it
goes against the idea that pg_stats is trying to hide the physical
representation of pg_statistic.  I wish we could use "tableoid",
but that's taken already as a system column.  Maybe "tableid" or
"tablerelid"?

Also, the proposed column ordering seems excessively random:

        n.nspname AS schemaname,
        c.relname AS tablename,
        s.starelid AS starelid,
        a.attnum AS attnum,
        a.attname AS attname,
        stainherit AS inherited,

I could see either of these as plausible:

        n.nspname AS schemaname,
        c.relname AS tablename,
        s.starelid AS tableid,
        a.attname AS attname,
        a.attnum AS attnum,
        stainherit AS inherited,

        n.nspname AS schemaname,
        c.relname AS tablename,
        a.attname AS attname,
        s.starelid AS tableid,
        a.attnum AS attnum,
        stainherit AS inherited,

but I don't see the rationale behind your version.

			regards, tom lane






view thread (36+ messages)  latest in thread

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Add starelid, attnum to pg_stats and leverage this in pg_dump
  In-Reply-To: <[email protected]>

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

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