pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Rethink function argument sorting in pg_dump. 3+ messages / 1 participants [nested] [flat]
* pgsql: Rethink function argument sorting in pg_dump. @ 2015-03-06 18:28 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2015-03-06 18:28 UTC (permalink / raw) To: pgsql-committers Rethink function argument sorting in pg_dump. Commit 7b583b20b1c95acb621c71251150beef958bb603 created an unnecessary dump failure hazard by applying pg_get_function_identity_arguments() to every function in the database, even those that won't get dumped. This could result in snapshot-related problems if concurrent sessions are, for example, creating and dropping temporary functions, as noted by Marko Tiikkaja in bug #12832. While this is by no means pg_dump's only such issue with concurrent DDL, it's unfortunate that we added a new failure mode for cases that used to work, and even more so that the failure was created for basically cosmetic reasons (ie, to sort overloaded functions more deterministically). To fix, revert that patch and instead sort function arguments using information that pg_dump has available anyway, namely the names of the argument types. This will produce a slightly different sort ordering for overloaded functions than the previous coding; but applying strcmp directly to the output of pg_get_function_identity_arguments really was a bit odd anyway. The sorting will still be name-based and hence independent of possibly-installation-specific OID assignments. A small additional benefit is that sorting now works regardless of server version. Back-patch to 9.3, where the previous commit appeared. Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/e3bfe6d84d4919433d8323cfb8194ca60d99f2c4 Modified Files -------------- src/bin/pg_dump/pg_dump.c | 47 ++-------------------------------------- src/bin/pg_dump/pg_dump.h | 1 - src/bin/pg_dump/pg_dump_sort.c | 23 +++++++++++++++++--- 3 files changed, 22 insertions(+), 49 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Rethink function argument sorting in pg_dump. @ 2015-03-06 18:28 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2015-03-06 18:28 UTC (permalink / raw) To: pgsql-committers Rethink function argument sorting in pg_dump. Commit 7b583b20b1c95acb621c71251150beef958bb603 created an unnecessary dump failure hazard by applying pg_get_function_identity_arguments() to every function in the database, even those that won't get dumped. This could result in snapshot-related problems if concurrent sessions are, for example, creating and dropping temporary functions, as noted by Marko Tiikkaja in bug #12832. While this is by no means pg_dump's only such issue with concurrent DDL, it's unfortunate that we added a new failure mode for cases that used to work, and even more so that the failure was created for basically cosmetic reasons (ie, to sort overloaded functions more deterministically). To fix, revert that patch and instead sort function arguments using information that pg_dump has available anyway, namely the names of the argument types. This will produce a slightly different sort ordering for overloaded functions than the previous coding; but applying strcmp directly to the output of pg_get_function_identity_arguments really was a bit odd anyway. The sorting will still be name-based and hence independent of possibly-installation-specific OID assignments. A small additional benefit is that sorting now works regardless of server version. Back-patch to 9.3, where the previous commit appeared. Branch ------ REL9_3_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/d645273cffa706936629891f84334a2f7a24232b Modified Files -------------- src/bin/pg_dump/pg_dump.c | 47 ++-------------------------------------- src/bin/pg_dump/pg_dump.h | 1 - src/bin/pg_dump/pg_dump_sort.c | 23 +++++++++++++++++--- 3 files changed, 22 insertions(+), 49 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Rethink function argument sorting in pg_dump. @ 2015-03-06 18:28 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2015-03-06 18:28 UTC (permalink / raw) To: pgsql-committers Rethink function argument sorting in pg_dump. Commit 7b583b20b1c95acb621c71251150beef958bb603 created an unnecessary dump failure hazard by applying pg_get_function_identity_arguments() to every function in the database, even those that won't get dumped. This could result in snapshot-related problems if concurrent sessions are, for example, creating and dropping temporary functions, as noted by Marko Tiikkaja in bug #12832. While this is by no means pg_dump's only such issue with concurrent DDL, it's unfortunate that we added a new failure mode for cases that used to work, and even more so that the failure was created for basically cosmetic reasons (ie, to sort overloaded functions more deterministically). To fix, revert that patch and instead sort function arguments using information that pg_dump has available anyway, namely the names of the argument types. This will produce a slightly different sort ordering for overloaded functions than the previous coding; but applying strcmp directly to the output of pg_get_function_identity_arguments really was a bit odd anyway. The sorting will still be name-based and hence independent of possibly-installation-specific OID assignments. A small additional benefit is that sorting now works regardless of server version. Back-patch to 9.3, where the previous commit appeared. Branch ------ REL9_4_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/629f8613f02239c69f20a42f00a548e808962415 Modified Files -------------- src/bin/pg_dump/pg_dump.c | 47 ++-------------------------------------- src/bin/pg_dump/pg_dump.h | 1 - src/bin/pg_dump/pg_dump_sort.c | 23 +++++++++++++++++--- 3 files changed, 22 insertions(+), 49 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2015-03-06 18:28 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2015-03-06 18:28 pgsql: Rethink function argument sorting in pg_dump. Tom Lane <tgl@sss.pgh.pa.us> 2015-03-06 18:28 pgsql: Rethink function argument sorting in pg_dump. Tom Lane <tgl@sss.pgh.pa.us> 2015-03-06 18:28 pgsql: Rethink function argument sorting in pg_dump. 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