]> granicus.if.org Git - postgresql/commitdiff
Fix privileges on pg_statistic_ext.tableoid
authorTomas Vondra <tomas.vondra@postgresql.org>
Sun, 16 Jun 2019 10:04:40 +0000 (12:04 +0200)
committerTomas Vondra <tomas.vondra@postgresql.org>
Sun, 16 Jun 2019 10:12:16 +0000 (12:12 +0200)
The GRANT in system_views allowed SELECT privileges on various columns in
the pg_statistic_ext catalog, but tableoid was not included in the list.
That made pg_dump fail because it's accessing this column when building
the list of extended statistics to dump.

Discussion: https://postgr.es/m/8833.1560647898%40sss.pgh.pa.us

src/backend/catalog/system_views.sql

index c8898901181fb20625265d1c298a643c0d1f2518..f9731453e3292a605dfa2c1a2b5377324edf1523 100644 (file)
@@ -291,7 +291,7 @@ CREATE VIEW pg_stats_ext WITH (security_barrier) AS
     AND (c.relrowsecurity = false OR NOT row_security_active(c.oid));
 
 REVOKE ALL on pg_statistic_ext FROM public;
-GRANT SELECT (oid, stxrelid, stxname, stxnamespace, stxowner, stxkeys, stxkind)
+GRANT SELECT (tableoid, oid, stxrelid, stxname, stxnamespace, stxowner, stxkeys, stxkind)
     ON pg_statistic_ext TO public;
 
 CREATE VIEW pg_publication_tables AS