* Alvaro Herrera (alvherre@2ndquadrant.com) wrote:
> 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
Errr, I could have sworn I was doing that, but clearly I'm not.
Will fix.
Thanks!
Stephen