Re: [PATCH] Sort policies and triggers by table name in pg_dump.
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Benjie Gillam <benjie@jemjie.com>
Cc: pgsql-hackers@postgresql.org
Date: 2019-09-24T02:02:13Z
Lists: pgsql-hackers
On Mon, Sep 23, 2019 at 10:34:07PM +0100, Benjie Gillam wrote:
> 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.
Could you provide a simple example of schema (tables with some
policies and triggers), with the difference this generates for
pg_dump, which shows your point?
> 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.
Your patch has two warnings because you are trying to map a policy
info pointer to a trigger info pointer:
pg_dump_sort.c:224:24: warning: initialization of ‘TriggerInfo *’ {aka
‘struct _triggerInfo *’} from incompatible pointer type ‘PolicyInfo *
const’ {aka ‘struct _policyInfo * const’}
[-Wincompatible-pointer-types]
224 | TriggerInfo *tobj2 = *(PolicyInfo *const *) p2;
--
Michael
Commits
-
Stabilize pg_dump output order for similarly-named triggers and policies.
- ee8b95f2684a 10.11 landed
- da5cd7a68a33 9.4.25 landed
- ca27a84c98f0 12.1 landed
- 74d32ee704eb 9.5.20 landed
- 648f17879e61 9.6.16 landed
- 5102f39440f7 13.0 landed
- 078f5bc8e307 11.6 landed