pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix pg_dump's failure to honor dependencies of SQL functions. 3+ messages / 1 participants [nested] [flat]
* pgsql: Fix pg_dump's failure to honor dependencies of SQL functions. @ 2023-06-04 17:06 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2023-06-04 17:06 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix pg_dump's failure to honor dependencies of SQL functions. A new-style SQL function can contain a parse-time dependency on a unique index, much as views and matviews can (such cases arise from GROUP BY and ON CONFLICT clauses, for example). To dump and restore such a function successfully, pg_dump must postpone the function until after the unique index is created, which will happen in the post-data part of the dump. Therefore we have to remove the normal constraint that functions are dumped in pre-data. Add code similar to the existing logic that handles this for matviews. I added test cases for both as well, since code coverage tests showed that we weren't testing the matview logic. Per report from Sami Imseih. Back-patch to v14 where new-style SQL functions came in. Discussion: https://postgr.es/m/2C1933AB-C2F8-499B-9D18-4AC1882256A0@amazon.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/01610747867ff26ca62d099e83e62d97730c40c1 Modified Files -------------- src/bin/pg_dump/pg_dump.c | 5 ++++- src/bin/pg_dump/pg_dump.h | 1 + src/bin/pg_dump/pg_dump_sort.c | 44 ++++++++++++++++++++++++++++++++++++++++ src/bin/pg_dump/t/002_pg_dump.pl | 40 ++++++++++++++++++++++++++++++++++++ 4 files changed, 89 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix pg_dump's failure to honor dependencies of SQL functions. @ 2023-06-04 17:06 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2023-06-04 17:06 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix pg_dump's failure to honor dependencies of SQL functions. A new-style SQL function can contain a parse-time dependency on a unique index, much as views and matviews can (such cases arise from GROUP BY and ON CONFLICT clauses, for example). To dump and restore such a function successfully, pg_dump must postpone the function until after the unique index is created, which will happen in the post-data part of the dump. Therefore we have to remove the normal constraint that functions are dumped in pre-data. Add code similar to the existing logic that handles this for matviews. I added test cases for both as well, since code coverage tests showed that we weren't testing the matview logic. Per report from Sami Imseih. Back-patch to v14 where new-style SQL functions came in. Discussion: https://postgr.es/m/2C1933AB-C2F8-499B-9D18-4AC1882256A0@amazon.com Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ca9e79274938d8ede07d9990c2f6f5107553b524 Modified Files -------------- src/bin/pg_dump/pg_dump.c | 5 ++++- src/bin/pg_dump/pg_dump.h | 1 + src/bin/pg_dump/pg_dump_sort.c | 44 ++++++++++++++++++++++++++++++++++++++++ src/bin/pg_dump/t/002_pg_dump.pl | 40 ++++++++++++++++++++++++++++++++++++ 4 files changed, 89 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix pg_dump's failure to honor dependencies of SQL functions. @ 2023-06-04 17:06 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2023-06-04 17:06 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix pg_dump's failure to honor dependencies of SQL functions. A new-style SQL function can contain a parse-time dependency on a unique index, much as views and matviews can (such cases arise from GROUP BY and ON CONFLICT clauses, for example). To dump and restore such a function successfully, pg_dump must postpone the function until after the unique index is created, which will happen in the post-data part of the dump. Therefore we have to remove the normal constraint that functions are dumped in pre-data. Add code similar to the existing logic that handles this for matviews. I added test cases for both as well, since code coverage tests showed that we weren't testing the matview logic. Per report from Sami Imseih. Back-patch to v14 where new-style SQL functions came in. Discussion: https://postgr.es/m/2C1933AB-C2F8-499B-9D18-4AC1882256A0@amazon.com Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d6f549d7a6275e16668faf8cddc95d6759506108 Modified Files -------------- src/bin/pg_dump/pg_dump.c | 5 ++++- src/bin/pg_dump/pg_dump.h | 1 + src/bin/pg_dump/pg_dump_sort.c | 44 ++++++++++++++++++++++++++++++++++++++++ src/bin/pg_dump/t/002_pg_dump.pl | 40 ++++++++++++++++++++++++++++++++++++ 4 files changed, 89 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2023-06-04 17:06 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-06-04 17:06 pgsql: Fix pg_dump's failure to honor dependencies of SQL functions. Tom Lane <tgl@sss.pgh.pa.us> 2023-06-04 17:06 pgsql: Fix pg_dump's failure to honor dependencies of SQL functions. Tom Lane <tgl@sss.pgh.pa.us> 2023-06-04 17:06 pgsql: Fix pg_dump's failure to honor dependencies of SQL functions. 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