Re: [PATCH] Sort policies and triggers by table name in pg_dump.

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [PATCH] Sort policies and triggers by table name in pg_dump.
Дата
Msg-id 20190924020213.GC2012@paquier.xyz
обсуждение исходный текст
Ответ на [PATCH] Sort policies and triggers by table name in pg_dump.  (Benjie Gillam <benjie@jemjie.com>)
Ответы Re: [PATCH] Sort policies and triggers by table name in pg_dump.  (Benjie Gillam <benjie@jemjie.com>)
Список 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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Amit Langote
Дата:
Сообщение: Fix example in partitioning documentation
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Add "password_protocol" connection parameter to libpq