false positive checks in pg_shdepend

37 views
Skip to first unread message

bohne...@googlemail.com

unread,
Oct 8, 2015, 1:23:10 PM10/8/15
to Postgres Catalog Checker
Thanks a lot for this great tool that helped me to fix a broken reference to a deleted schema, that impeded a database backup.

However, pg_catcheck prodices a false positive,
if a have in the "database1" for example granted a select on a specific column to another group:

In database1:
GRANT SELECT(mycolumn) ON schema.mytable TO some_group;

If i run pg_catcheck on database1, everything is fine.
But if i run pg_catcheck on any other database, it raises errors like

(...)
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)

where database1 has the oid 2483041 and the table "mytable" has the oid 2488839 and the column "mycolumn" is the 23th column.

So maybe the method "not_for_this_database" in check_depend.c does not work properly in this case.

Thanks,
Max



 

Rushabh Lathia

unread,
Oct 14, 2015, 2:52:21 AM10/14/15
to bohne...@googlemail.com, Postgres Catalog Checker
PFA patch to fix the issue.

Basically "not_for_this_database" was missing for check_dependency_subid() function.
Added the same to fix the issue.

Regards,


--
You received this message because you are subscribed to the Google Groups "Postgres Catalog Checker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pg-catcheck...@enterprisedb.com.
To post to this group, send email to pg-ca...@enterprisedb.com.
Visit this group at http://groups.google.com/a/enterprisedb.com/group/pg-catcheck/.



--
--
Rushabh Lathia
Database Architect
EnterpriseDB Corporation
The Enterprise Postgres Company

Phone: +91-20-30589494

Website: http://www.enterprisedb.com
EnterpriseDB Blog: http://blogs.enterprisedb.com/
Follow us on Twitter: http://www.twitter.com/enterprisedb

missing_not_for_this_database_check.patch

Robert Haas

unread,
Oct 14, 2015, 1:50:13 PM10/14/15
to Rushabh Lathia, bohne...@googlemail.com, Postgres Catalog Checker
On Wed, Oct 14, 2015 at 2:52 AM, Rushabh Lathia
<rushabh...@enterprisedb.com> wrote:
> PFA patch to fix the issue.
>
> Basically "not_for_this_database" was missing for check_dependency_subid()
> function.
> Added the same to fix the issue.

Max, thanks for the report. Rushabh, thanks for the patch. Committed.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Reply all
Reply to author
Forward
0 new messages