[PATCH] Sort policies and triggers by table name in pg_dump. - Mailing list pgsql-hackers

From Benjie Gillam
Subject [PATCH] Sort policies and triggers by table name in pg_dump.
Date
Msg-id CAMThMzEEt2mvBbPgCaZ1Ap1N-moGn=Edxmadddjq89WG4NpPtQ@mail.gmail.com
Whole thread Raw
Responses Re: [PATCH] Sort policies and triggers by table name in pg_dump.
List pgsql-hackers
Hello all,

Currently pg_dump sorts most dumpable objects by priority, namespace, name
and then object ID. Since triggers and RLS policies belong to tables, there
may be more than one with the same name within the same namespace, leading to
potential sorting discrepancies between databases that only differ by object
IDs.

The attached draft patch (made against `pg_dump_sort.c` on master) breaks
ties for trigger and policy objects by using the table name, increasing the
sort order stability. I have compiled it and executed it against a number of
local databases and it behaves as desired.

I am new to PostgreSQL contribution and my C-skills are rusty, so please let
me know if I can improve the patch, or if there are areas of PostgreSQL that
I have overlooked.

Kind regards,

Benjie Gillam

Attachment

pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: Efficient output for integer types
Next
From: David Fetter
Date:
Subject: Re: Efficient output for integer types