pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Ensure schema qualification in pg_restore DISABLE/ENABLE TRIGGER 7+ messages / 1 participants [nested] [flat]
* pgsql: Ensure schema qualification in pg_restore DISABLE/ENABLE TRIGGER @ 2018-08-17 21:12 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-08-17 21:12 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Ensure schema qualification in pg_restore DISABLE/ENABLE TRIGGER commands. Previously, this code blindly followed the common coding pattern of passing PQserverVersion(AH->connection) as the server-version parameter of fmtQualifiedId. That works as long as we have a connection; but in pg_restore with text output, we don't. Instead we got a zero from PQserverVersion, which fmtQualifiedId interpreted as "server is too old to have schemas", and so the name went unqualified. That still accidentally managed to work in many cases, which is probably why this ancient bug went undetected for so long. It only became obvious in the wake of the changes to force dump/restore to execute with restricted search_path. In HEAD/v11, let's deal with this by ripping out fmtQualifiedId's server- version behavioral dependency, and just making it schema-qualify all the time. We no longer support pg_dump from servers old enough to need the ability to omit schema name, let alone restoring to them. (Also, the few callers outside pg_dump already didn't work with pre-schema servers.) In older branches, that's not an acceptable solution, so instead just tweak the DISABLE/ENABLE TRIGGER logic to ensure it will schema-qualify its output regardless of server version. Per bug #15338 from Oleg somebody. Back-patch to all supported branches. Discussion: https://postgr.es/m/153452458706.1316.5328079417086507743@wrigleys.postgresql.org Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/6771c932cf5a8bbb8219461066987ad3b11688ff Modified Files -------------- src/bin/pg_dump/parallel.c | 2 +- src/bin/pg_dump/pg_backup_archiver.c | 12 +++--------- src/bin/pg_dump/pg_dump.c | 4 +--- src/bin/scripts/common.c | 3 +-- src/bin/scripts/vacuumdb.c | 3 +-- src/fe_utils/string_utils.c | 9 ++++----- src/include/fe_utils/string_utils.h | 3 +-- 7 files changed, 12 insertions(+), 24 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Ensure schema qualification in pg_restore DISABLE/ENABLE TRIGGER @ 2018-08-17 21:12 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-08-17 21:12 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Ensure schema qualification in pg_restore DISABLE/ENABLE TRIGGER commands. Previously, this code blindly followed the common coding pattern of passing PQserverVersion(AH->connection) as the server-version parameter of fmtQualifiedId. That works as long as we have a connection; but in pg_restore with text output, we don't. Instead we got a zero from PQserverVersion, which fmtQualifiedId interpreted as "server is too old to have schemas", and so the name went unqualified. That still accidentally managed to work in many cases, which is probably why this ancient bug went undetected for so long. It only became obvious in the wake of the changes to force dump/restore to execute with restricted search_path. In HEAD/v11, let's deal with this by ripping out fmtQualifiedId's server- version behavioral dependency, and just making it schema-qualify all the time. We no longer support pg_dump from servers old enough to need the ability to omit schema name, let alone restoring to them. (Also, the few callers outside pg_dump already didn't work with pre-schema servers.) In older branches, that's not an acceptable solution, so instead just tweak the DISABLE/ENABLE TRIGGER logic to ensure it will schema-qualify its output regardless of server version. Per bug #15338 from Oleg somebody. Back-patch to all supported branches. Discussion: https://postgr.es/m/153452458706.1316.5328079417086507743@wrigleys.postgresql.org Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d73093c4ffefebadd25ea855bd8745f4fcb4462a Modified Files -------------- src/bin/pg_dump/parallel.c | 2 +- src/bin/pg_dump/pg_backup_archiver.c | 12 +++--------- src/bin/pg_dump/pg_dump.c | 4 +--- src/bin/scripts/common.c | 3 +-- src/bin/scripts/vacuumdb.c | 3 +-- src/fe_utils/string_utils.c | 9 ++++----- src/include/fe_utils/string_utils.h | 3 +-- 7 files changed, 12 insertions(+), 24 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Ensure schema qualification in pg_restore DISABLE/ENABLE TRIGGER @ 2018-08-17 21:12 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-08-17 21:12 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Ensure schema qualification in pg_restore DISABLE/ENABLE TRIGGER commands. Previously, this code blindly followed the common coding pattern of passing PQserverVersion(AH->connection) as the server-version parameter of fmtQualifiedId. That works as long as we have a connection; but in pg_restore with text output, we don't. Instead we got a zero from PQserverVersion, which fmtQualifiedId interpreted as "server is too old to have schemas", and so the name went unqualified. That still accidentally managed to work in many cases, which is probably why this ancient bug went undetected for so long. It only became obvious in the wake of the changes to force dump/restore to execute with restricted search_path. In HEAD/v11, let's deal with this by ripping out fmtQualifiedId's server- version behavioral dependency, and just making it schema-qualify all the time. We no longer support pg_dump from servers old enough to need the ability to omit schema name, let alone restoring to them. (Also, the few callers outside pg_dump already didn't work with pre-schema servers.) In older branches, that's not an acceptable solution, so instead just tweak the DISABLE/ENABLE TRIGGER logic to ensure it will schema-qualify its output regardless of server version. Per bug #15338 from Oleg somebody. Back-patch to all supported branches. Discussion: https://postgr.es/m/153452458706.1316.5328079417086507743@wrigleys.postgresql.org Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/05aeeb5e2803ebe537516774f766792c109eaac5 Modified Files -------------- src/bin/pg_dump/pg_backup_archiver.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Ensure schema qualification in pg_restore DISABLE/ENABLE TRIGGER @ 2018-08-17 21:12 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-08-17 21:12 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Ensure schema qualification in pg_restore DISABLE/ENABLE TRIGGER commands. Previously, this code blindly followed the common coding pattern of passing PQserverVersion(AH->connection) as the server-version parameter of fmtQualifiedId. That works as long as we have a connection; but in pg_restore with text output, we don't. Instead we got a zero from PQserverVersion, which fmtQualifiedId interpreted as "server is too old to have schemas", and so the name went unqualified. That still accidentally managed to work in many cases, which is probably why this ancient bug went undetected for so long. It only became obvious in the wake of the changes to force dump/restore to execute with restricted search_path. In HEAD/v11, let's deal with this by ripping out fmtQualifiedId's server- version behavioral dependency, and just making it schema-qualify all the time. We no longer support pg_dump from servers old enough to need the ability to omit schema name, let alone restoring to them. (Also, the few callers outside pg_dump already didn't work with pre-schema servers.) In older branches, that's not an acceptable solution, so instead just tweak the DISABLE/ENABLE TRIGGER logic to ensure it will schema-qualify its output regardless of server version. Per bug #15338 from Oleg somebody. Back-patch to all supported branches. Discussion: https://postgr.es/m/153452458706.1316.5328079417086507743@wrigleys.postgresql.org Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/72329ba03b601bcd0cfe1349a9acdd251972cbd0 Modified Files -------------- src/bin/pg_dump/pg_backup_archiver.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Ensure schema qualification in pg_restore DISABLE/ENABLE TRIGGER @ 2018-08-17 21:12 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-08-17 21:12 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Ensure schema qualification in pg_restore DISABLE/ENABLE TRIGGER commands. Previously, this code blindly followed the common coding pattern of passing PQserverVersion(AH->connection) as the server-version parameter of fmtQualifiedId. That works as long as we have a connection; but in pg_restore with text output, we don't. Instead we got a zero from PQserverVersion, which fmtQualifiedId interpreted as "server is too old to have schemas", and so the name went unqualified. That still accidentally managed to work in many cases, which is probably why this ancient bug went undetected for so long. It only became obvious in the wake of the changes to force dump/restore to execute with restricted search_path. In HEAD/v11, let's deal with this by ripping out fmtQualifiedId's server- version behavioral dependency, and just making it schema-qualify all the time. We no longer support pg_dump from servers old enough to need the ability to omit schema name, let alone restoring to them. (Also, the few callers outside pg_dump already didn't work with pre-schema servers.) In older branches, that's not an acceptable solution, so instead just tweak the DISABLE/ENABLE TRIGGER logic to ensure it will schema-qualify its output regardless of server version. Per bug #15338 from Oleg somebody. Back-patch to all supported branches. Discussion: https://postgr.es/m/153452458706.1316.5328079417086507743@wrigleys.postgresql.org Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/3998dfe1b5107e6c39e9c90ca856144e1094385a Modified Files -------------- src/bin/pg_dump/pg_backup_archiver.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Ensure schema qualification in pg_restore DISABLE/ENABLE TRIGGER @ 2018-08-17 21:12 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-08-17 21:12 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Ensure schema qualification in pg_restore DISABLE/ENABLE TRIGGER commands. Previously, this code blindly followed the common coding pattern of passing PQserverVersion(AH->connection) as the server-version parameter of fmtQualifiedId. That works as long as we have a connection; but in pg_restore with text output, we don't. Instead we got a zero from PQserverVersion, which fmtQualifiedId interpreted as "server is too old to have schemas", and so the name went unqualified. That still accidentally managed to work in many cases, which is probably why this ancient bug went undetected for so long. It only became obvious in the wake of the changes to force dump/restore to execute with restricted search_path. In HEAD/v11, let's deal with this by ripping out fmtQualifiedId's server- version behavioral dependency, and just making it schema-qualify all the time. We no longer support pg_dump from servers old enough to need the ability to omit schema name, let alone restoring to them. (Also, the few callers outside pg_dump already didn't work with pre-schema servers.) In older branches, that's not an acceptable solution, so instead just tweak the DISABLE/ENABLE TRIGGER logic to ensure it will schema-qualify its output regardless of server version. Per bug #15338 from Oleg somebody. Back-patch to all supported branches. Discussion: https://postgr.es/m/153452458706.1316.5328079417086507743@wrigleys.postgresql.org Branch ------ REL9_4_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/a4fdcceaba1fa5c70dde920b5a22b3896c55efd1 Modified Files -------------- src/bin/pg_dump/pg_backup_archiver.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Ensure schema qualification in pg_restore DISABLE/ENABLE TRIGGER @ 2018-08-17 21:12 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-08-17 21:12 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Ensure schema qualification in pg_restore DISABLE/ENABLE TRIGGER commands. Previously, this code blindly followed the common coding pattern of passing PQserverVersion(AH->connection) as the server-version parameter of fmtQualifiedId. That works as long as we have a connection; but in pg_restore with text output, we don't. Instead we got a zero from PQserverVersion, which fmtQualifiedId interpreted as "server is too old to have schemas", and so the name went unqualified. That still accidentally managed to work in many cases, which is probably why this ancient bug went undetected for so long. It only became obvious in the wake of the changes to force dump/restore to execute with restricted search_path. In HEAD/v11, let's deal with this by ripping out fmtQualifiedId's server- version behavioral dependency, and just making it schema-qualify all the time. We no longer support pg_dump from servers old enough to need the ability to omit schema name, let alone restoring to them. (Also, the few callers outside pg_dump already didn't work with pre-schema servers.) In older branches, that's not an acceptable solution, so instead just tweak the DISABLE/ENABLE TRIGGER logic to ensure it will schema-qualify its output regardless of server version. Per bug #15338 from Oleg somebody. Back-patch to all supported branches. Discussion: https://postgr.es/m/153452458706.1316.5328079417086507743@wrigleys.postgresql.org Branch ------ REL9_3_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b2171d472dc77d176bc71a584ec3a2b48faa9d21 Modified Files -------------- src/bin/pg_dump/pg_backup_archiver.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2018-08-17 21:12 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2018-08-17 21:12 pgsql: Ensure schema qualification in pg_restore DISABLE/ENABLE TRIGGER Tom Lane <tgl@sss.pgh.pa.us> 2018-08-17 21:12 pgsql: Ensure schema qualification in pg_restore DISABLE/ENABLE TRIGGER Tom Lane <tgl@sss.pgh.pa.us> 2018-08-17 21:12 pgsql: Ensure schema qualification in pg_restore DISABLE/ENABLE TRIGGER Tom Lane <tgl@sss.pgh.pa.us> 2018-08-17 21:12 pgsql: Ensure schema qualification in pg_restore DISABLE/ENABLE TRIGGER Tom Lane <tgl@sss.pgh.pa.us> 2018-08-17 21:12 pgsql: Ensure schema qualification in pg_restore DISABLE/ENABLE TRIGGER Tom Lane <tgl@sss.pgh.pa.us> 2018-08-17 21:12 pgsql: Ensure schema qualification in pg_restore DISABLE/ENABLE TRIGGER Tom Lane <tgl@sss.pgh.pa.us> 2018-08-17 21:12 pgsql: Ensure schema qualification in pg_restore DISABLE/ENABLE TRIGGER 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