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

Поиск
Список
Период
Сортировка
От Benjie Gillam
Тема Re: [PATCH] Sort policies and triggers by table name in pg_dump.
Дата
Msg-id CAMThMzFTakHM90GphqaAmWXacrAYZFoZvGgL0W=9siZL-Ge3ug@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] Sort policies and triggers by table name in pg_dump.  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: [PATCH] Sort policies and triggers by table name in pg_dump.  (Michael Paquier <michael@paquier.xyz>)
Re: [PATCH] Sort policies and triggers by table name in pg_dump.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> 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?

Certainly; I've attached a bash script that can reproduce the issue
and the diff that it produces, here's the important part:

    CREATE TRIGGER a BEFORE INSERT ON foo
        FOR EACH ROW EXECUTE PROCEDURE qux();
    CREATE POLICY a ON foo FOR SELECT USING (true);

    CREATE TRIGGER a BEFORE INSERT ON bar
        FOR EACH ROW EXECUTE PROCEDURE qux();
    CREATE POLICY a ON bar FOR SELECT USING (true);

Here we create two identically named triggers and two identically
named policies on tables foo and bar. If instead we ran these
statements in a different order (or if the object IDs were to wrap)
the order of the pg_dump would be different even though the
databases are identical other than object IDs. The attached
patch eliminates this difference.

> Your patch has two warnings because you are trying to map a policy
> info pointer to a trigger info pointer:

Ah, thank you for the pointer (aha); I've attached an updated patch
that addresses this copy/paste issue.

Вложения

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

Предыдущее
От: Julien Rouhaud
Дата:
Сообщение: Re: Hypothetical indexes using BRIN broken since pg10
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: Index Skip Scan