pgsql: Make pg_dump's table of object-type priorities more maintainable - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Make pg_dump's table of object-type priorities more maintainable
Date
Msg-id E1kz97q-0000fZ-Np@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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(-)


pgsql-committers by date:

Previous
From: Thomas Munro
Date:
Subject: pgsql: Fix function prototypes in dependency.h.
Next
From: Amit Kapila
Date:
Subject: pgsql: Optimize DropRelFileNodeBuffers() for recovery.