From 3a99d2017b6a7774b15f55201ce64c74934caa7a Mon Sep 17 00:00:00 2001 From: Euler Taveira Date: Wed, 2 Aug 2023 19:44:37 -0300 Subject: [PATCH v1] Fix column-level ACL for selective restore pg_restore skips column-level ACL when using a selective restore. The issue is that some objects are skipped if it has multiple dependencies. It used to be true for column-level ACL (it depends only on table object) but an extra dependency for table ACL was added by commit ea9125304d . Hence, it cannot rely on the number of dependencies (added in commit 0d4e6ed3085) for this case. Ignore dependencies on ACLs for selective restore. Discussion: https://postgr.es/m/DM4PR11MB73976902DBBA10B1D652F9498B06A%40DM4PR11MB7397.namprd11.prod.outlook.com --- src/bin/pg_dump/pg_backup_archiver.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c index 39ebcfec32..2a25defe88 100644 --- a/src/bin/pg_dump/pg_backup_archiver.c +++ b/src/bin/pg_dump/pg_backup_archiver.c @@ -2891,6 +2891,10 @@ _tocEntryRequired(TocEntry *te, teSection curSection, ArchiveHandle *AH) ropt->schemaExcludeNames.head != NULL || ropt->selTypes) { + /* Ignore dependencies on ACL. */ + if (strcmp(te->desc, "ACL") == 0) + return REQ_SCHEMA; + /* * In a selective dump/restore, we want to restore these dependent * TOC entry types only if their parent object is being restored. -- 2.30.2