Re: pg_dump dump catalog ACLs
От | Alvaro Herrera |
---|---|
Тема | Re: pg_dump dump catalog ACLs |
Дата | |
Msg-id | 20160510174333.GA554972@alvherre.pgsql обсуждение исходный текст |
Ответ на | Re: pg_dump dump catalog ACLs (Stephen Frost <sfrost@snowman.net>) |
Ответы |
Re: pg_dump dump catalog ACLs
Re: pg_dump dump catalog ACLs |
Список | pgsql-hackers |
Stephen Frost wrote: > diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c > index 1267afb..4a9b1bf 100644 > --- a/src/bin/pg_dump/pg_dump.c > +++ b/src/bin/pg_dump/pg_dump.c > @@ -14992,9 +14992,10 @@ dumpTable(Archive *fout, TableInfo *tbinfo) > "%s AS initrattacl " > "FROM pg_catalog.pg_attribute at " > "JOIN pg_catalog.pg_class c ON (at.attrelid = c.oid) " > - "LEFT JOIN pg_init_privs pip ON " > + "LEFT JOIN pg_catalog.pg_init_privs pip ON " > "(pip.classoid = " > - "(SELECT oid FROM pg_class WHERE relname = 'pg_class') AND " > + "(SELECT oid FROM pg_catalog.pg_class " > + "WHERE relname = 'pg_class') AND " > " at.attrelid = pip.objoid AND at.attnum = pip.objsubid) " > "WHERE at.attrelid = '%u' AND " > "NOT at.attisdropped " The subquery comparing the OID of pg_class using only a condition on relname seems wrong; wouldn't it fail or produce wrong results if somebody creates a table named pg_class in another schema? I think you should write the comparison like this instead: classoid = 'pg_catalog.pg_class'::regclass -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
В списке pgsql-hackers по дате отправления: