pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix omission of column-level privileges in selective pg_restore. 7+ messages / 1 participants [nested] [flat]
* pgsql: Fix omission of column-level privileges in selective pg_restore. @ 2023-10-02 17:28 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2023-10-02 17:28 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix omission of column-level privileges in selective pg_restore. In a selective restore, ACLs for a table should be dumped if the table is selected to be dumped. However, if the table has both table-level and column-level ACLs, only the table-level ACL was restored. This happened because _tocEntryRequired assumed that an ACL could have only one dependency (the one on its table), and punted if there was more than one. But since commit ea9125304, column-level ACLs also depend on the table-level ACL if any, to ensure correct ordering in parallel restores. To fix, adjust the logic in _tocEntryRequired to ignore dependencies on ACLs. I extended a test case in 002_pg_dump.pl so that it purports to test for this; but in fact the test passes even without the fix. That's because this bug only manifests during a selective restore, while the scenarios 002_pg_dump.pl tests include only selective dumps. Perhaps somebody would like to extend the script so that it can test scenarios including selective restore, but I'm not touching that. Euler Taveira and Tom Lane, per report from Kong Man. Back-patch to all supported branches. Discussion: https://postgr.es/m/DM4PR11MB73976902DBBA10B1D652F9498B06A@DM4PR11MB7397.namprd11.prod.outlook.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/06c0c36884a5c9ced6d6a90f8b47540464b28e3a Modified Files -------------- src/bin/pg_dump/pg_backup_archiver.c | 24 +++++++++++++++++++++--- src/bin/pg_dump/t/002_pg_dump.pl | 10 ++++++---- 2 files changed, 27 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix omission of column-level privileges in selective pg_restore. @ 2023-10-02 17:28 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2023-10-02 17:28 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix omission of column-level privileges in selective pg_restore. In a selective restore, ACLs for a table should be dumped if the table is selected to be dumped. However, if the table has both table-level and column-level ACLs, only the table-level ACL was restored. This happened because _tocEntryRequired assumed that an ACL could have only one dependency (the one on its table), and punted if there was more than one. But since commit ea9125304, column-level ACLs also depend on the table-level ACL if any, to ensure correct ordering in parallel restores. To fix, adjust the logic in _tocEntryRequired to ignore dependencies on ACLs. I extended a test case in 002_pg_dump.pl so that it purports to test for this; but in fact the test passes even without the fix. That's because this bug only manifests during a selective restore, while the scenarios 002_pg_dump.pl tests include only selective dumps. Perhaps somebody would like to extend the script so that it can test scenarios including selective restore, but I'm not touching that. Euler Taveira and Tom Lane, per report from Kong Man. Back-patch to all supported branches. Discussion: https://postgr.es/m/DM4PR11MB73976902DBBA10B1D652F9498B06A@DM4PR11MB7397.namprd11.prod.outlook.com Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/aaaf8fbb67f844cd0b20648697320d940b4b8eb9 Modified Files -------------- src/bin/pg_dump/pg_backup_archiver.c | 24 +++++++++++++++++++++--- src/bin/pg_dump/t/002_pg_dump.pl | 10 ++++++---- 2 files changed, 27 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix omission of column-level privileges in selective pg_restore. @ 2023-10-02 17:28 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2023-10-02 17:28 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix omission of column-level privileges in selective pg_restore. In a selective restore, ACLs for a table should be dumped if the table is selected to be dumped. However, if the table has both table-level and column-level ACLs, only the table-level ACL was restored. This happened because _tocEntryRequired assumed that an ACL could have only one dependency (the one on its table), and punted if there was more than one. But since commit ea9125304, column-level ACLs also depend on the table-level ACL if any, to ensure correct ordering in parallel restores. To fix, adjust the logic in _tocEntryRequired to ignore dependencies on ACLs. I extended a test case in 002_pg_dump.pl so that it purports to test for this; but in fact the test passes even without the fix. That's because this bug only manifests during a selective restore, while the scenarios 002_pg_dump.pl tests include only selective dumps. Perhaps somebody would like to extend the script so that it can test scenarios including selective restore, but I'm not touching that. Euler Taveira and Tom Lane, per report from Kong Man. Back-patch to all supported branches. Discussion: https://postgr.es/m/DM4PR11MB73976902DBBA10B1D652F9498B06A@DM4PR11MB7397.namprd11.prod.outlook.com Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/10e705bd2445ae5a7276b1fa3e1c52c6be522055 Modified Files -------------- src/bin/pg_dump/pg_backup_archiver.c | 24 +++++++++++++++++++++--- src/bin/pg_dump/t/002_pg_dump.pl | 10 ++++++---- 2 files changed, 27 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix omission of column-level privileges in selective pg_restore. @ 2023-10-02 17:28 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2023-10-02 17:28 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix omission of column-level privileges in selective pg_restore. In a selective restore, ACLs for a table should be dumped if the table is selected to be dumped. However, if the table has both table-level and column-level ACLs, only the table-level ACL was restored. This happened because _tocEntryRequired assumed that an ACL could have only one dependency (the one on its table), and punted if there was more than one. But since commit ea9125304, column-level ACLs also depend on the table-level ACL if any, to ensure correct ordering in parallel restores. To fix, adjust the logic in _tocEntryRequired to ignore dependencies on ACLs. I extended a test case in 002_pg_dump.pl so that it purports to test for this; but in fact the test passes even without the fix. That's because this bug only manifests during a selective restore, while the scenarios 002_pg_dump.pl tests include only selective dumps. Perhaps somebody would like to extend the script so that it can test scenarios including selective restore, but I'm not touching that. Euler Taveira and Tom Lane, per report from Kong Man. Back-patch to all supported branches. Discussion: https://postgr.es/m/DM4PR11MB73976902DBBA10B1D652F9498B06A@DM4PR11MB7397.namprd11.prod.outlook.com Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/829d91cc62b8769c27ed0eb368500fc5664f5fa7 Modified Files -------------- src/bin/pg_dump/pg_backup_archiver.c | 24 +++++++++++++++++++++--- src/bin/pg_dump/t/002_pg_dump.pl | 8 +++++--- 2 files changed, 26 insertions(+), 6 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix omission of column-level privileges in selective pg_restore. @ 2023-10-02 17:28 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2023-10-02 17:28 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix omission of column-level privileges in selective pg_restore. In a selective restore, ACLs for a table should be dumped if the table is selected to be dumped. However, if the table has both table-level and column-level ACLs, only the table-level ACL was restored. This happened because _tocEntryRequired assumed that an ACL could have only one dependency (the one on its table), and punted if there was more than one. But since commit ea9125304, column-level ACLs also depend on the table-level ACL if any, to ensure correct ordering in parallel restores. To fix, adjust the logic in _tocEntryRequired to ignore dependencies on ACLs. I extended a test case in 002_pg_dump.pl so that it purports to test for this; but in fact the test passes even without the fix. That's because this bug only manifests during a selective restore, while the scenarios 002_pg_dump.pl tests include only selective dumps. Perhaps somebody would like to extend the script so that it can test scenarios including selective restore, but I'm not touching that. Euler Taveira and Tom Lane, per report from Kong Man. Back-patch to all supported branches. Discussion: https://postgr.es/m/DM4PR11MB73976902DBBA10B1D652F9498B06A@DM4PR11MB7397.namprd11.prod.outlook.com Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/295953f8beff2c8e074967592a222375355c71f7 Modified Files -------------- src/bin/pg_dump/pg_backup_archiver.c | 24 +++++++++++++++++++++--- src/bin/pg_dump/t/002_pg_dump.pl | 8 +++++--- 2 files changed, 26 insertions(+), 6 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix omission of column-level privileges in selective pg_restore. @ 2023-10-02 17:28 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2023-10-02 17:28 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix omission of column-level privileges in selective pg_restore. In a selective restore, ACLs for a table should be dumped if the table is selected to be dumped. However, if the table has both table-level and column-level ACLs, only the table-level ACL was restored. This happened because _tocEntryRequired assumed that an ACL could have only one dependency (the one on its table), and punted if there was more than one. But since commit ea9125304, column-level ACLs also depend on the table-level ACL if any, to ensure correct ordering in parallel restores. To fix, adjust the logic in _tocEntryRequired to ignore dependencies on ACLs. I extended a test case in 002_pg_dump.pl so that it purports to test for this; but in fact the test passes even without the fix. That's because this bug only manifests during a selective restore, while the scenarios 002_pg_dump.pl tests include only selective dumps. Perhaps somebody would like to extend the script so that it can test scenarios including selective restore, but I'm not touching that. Euler Taveira and Tom Lane, per report from Kong Man. Back-patch to all supported branches. Discussion: https://postgr.es/m/DM4PR11MB73976902DBBA10B1D652F9498B06A@DM4PR11MB7397.namprd11.prod.outlook.com Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/c02f29758bc8ccfb77e6bc84b248283ce87efb8f Modified Files -------------- src/bin/pg_dump/pg_backup_archiver.c | 24 +++++++++++++++++++++--- src/bin/pg_dump/t/002_pg_dump.pl | 8 +++++--- 2 files changed, 26 insertions(+), 6 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix omission of column-level privileges in selective pg_restore. @ 2023-10-02 17:28 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2023-10-02 17:28 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix omission of column-level privileges in selective pg_restore. In a selective restore, ACLs for a table should be dumped if the table is selected to be dumped. However, if the table has both table-level and column-level ACLs, only the table-level ACL was restored. This happened because _tocEntryRequired assumed that an ACL could have only one dependency (the one on its table), and punted if there was more than one. But since commit ea9125304, column-level ACLs also depend on the table-level ACL if any, to ensure correct ordering in parallel restores. To fix, adjust the logic in _tocEntryRequired to ignore dependencies on ACLs. I extended a test case in 002_pg_dump.pl so that it purports to test for this; but in fact the test passes even without the fix. That's because this bug only manifests during a selective restore, while the scenarios 002_pg_dump.pl tests include only selective dumps. Perhaps somebody would like to extend the script so that it can test scenarios including selective restore, but I'm not touching that. Euler Taveira and Tom Lane, per report from Kong Man. Back-patch to all supported branches. Discussion: https://postgr.es/m/DM4PR11MB73976902DBBA10B1D652F9498B06A@DM4PR11MB7397.namprd11.prod.outlook.com Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/4f16152d9711a59e1b2ad8a4bc26d4455da709e6 Modified Files -------------- src/bin/pg_dump/pg_backup_archiver.c | 25 ++++++++++++++++++++++--- src/bin/pg_dump/t/002_pg_dump.pl | 8 +++++--- 2 files changed, 27 insertions(+), 6 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2023-10-02 17:28 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-10-02 17:28 pgsql: Fix omission of column-level privileges in selective pg_restore. Tom Lane <tgl@sss.pgh.pa.us> 2023-10-02 17:28 pgsql: Fix omission of column-level privileges in selective pg_restore. Tom Lane <tgl@sss.pgh.pa.us> 2023-10-02 17:28 pgsql: Fix omission of column-level privileges in selective pg_restore. Tom Lane <tgl@sss.pgh.pa.us> 2023-10-02 17:28 pgsql: Fix omission of column-level privileges in selective pg_restore. Tom Lane <tgl@sss.pgh.pa.us> 2023-10-02 17:28 pgsql: Fix omission of column-level privileges in selective pg_restore. Tom Lane <tgl@sss.pgh.pa.us> 2023-10-02 17:28 pgsql: Fix omission of column-level privileges in selective pg_restore. Tom Lane <tgl@sss.pgh.pa.us> 2023-10-02 17:28 pgsql: Fix omission of column-level privileges in selective pg_restore. Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox