pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Make pg_dump's table of object-type priorities more maintainable
Date: Tue, 12 Jan 2021 02:09:38 +0000
Message-ID: <E1kz97q-0000fZ-Np@gemulon.postgresql.org> (raw)

Make pg_dump's table of object-type priorities more maintainable.

Wedging a new object type into this table has historically required
manually renumbering a lot of existing entries.  (Although it appears
that some people got lazy and re-used the priority level of an
existing object type, even if it wasn't particularly related.)
We can let the compiler do the counting by inventing an enum type that
lists the desired priority levels in order.  Now, if you want to add
or remove a priority level, that's a one-liner.

This patch is not purely cosmetic, because I split apart the priorities
of DO_COLLATION and DO_TRANSFORM, as well as those of DO_ACCESS_METHOD
and DO_OPERATOR, which look to me to have been merged out of expediency
rather than because it was a good idea.  Shell types continue to be
sorted interchangeably with full types, and opclasses interchangeably
with opfamilies.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d5ab79d815783fe60062cefc423b54e82fbb92ff

Modified Files
--------------
src/bin/pg_dump/pg_dump_sort.c | 137 ++++++++++++++++++++++++++++-------------
1 file changed, 93 insertions(+), 44 deletions(-)



Message-ID: <E1kz97q-0000fZ-Np@gemulon.postgresql.org>
Permalink:  ../E1kz97q-0000fZ-Np@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1kz97q-0000fZ-Np@gemulon.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-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Make pg_dump's table of object-type priorities more maintainable
  In-Reply-To: <E1kz97q-0000fZ-Np@gemulon.postgresql.org>
  References: <E1kz97q-0000fZ-Np@gemulon.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