False positive in check for pg_shdepend

16 views
Skip to first unread message

bohne...@googlemail.com

unread,
Oct 8, 2015, 1:23:11 PM10/8/15
to Postgres Catalog Checker
Thanks a lot for this great tool which helped me to fix an error in a database because of references to a deleted schema.
Now i can dump the database again, which was not possible before.

However, pg_catcheck (build from commit  fcf88dfe24a2c0d6cd21d404b59c67c80ecdd261) still reports false positive errors from pg_shdepend:

i have ad db-server with several databases, one of them with the oid 2483041 is namend "han"

"pg_catcheck han" reports no error

however, "pg_catcheck anyotherdatabase"
reports the following errors:

notice: pg_shdepend row has invalid objsubid "1": no matching entry in pg_attribute
row identity: dbid="2483041" classid="1259" objid="2485047" objsubid="1" refclassid="1260" refobjid="2483040" deptype="a"
...
notice: pg_shdepend row has invalid objsubid "23": no matching entry in pg_attribute
row identity: dbid="2483041" classid="1259" objid="2488839" objsubid="23" refclassid="1260" refobjid="2483040" deptype="a"
progress: done (20 inconsistencies, 0 warnings, 0 errors)

So pg_catcheck searches the table 2488839 with column 23 in the database "anyotherdatabase" but does not find it. But in database "han" this table and column exists and on this column the access to a specific column is granted to another user. So the reference is to the pg_auth table. This is correct.


Maybe the method "not_for_this_database(check_depend_cache *cache, pg_catalog_table *tab, pg_catalog_column *tabcol, int rownum) " in check_depend.c does not work properly?

In the source code, i couldn't spot the error.
But a simple testcase would be to grant access on a column of a table in one database:

GRANT SELECT(column_x) ON schema.table TO group2;

and then to run
pg_catcheck on any other database.

Thanks,
Max

Reply all
Reply to author
Forward
0 new messages