- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit6cead41
committed
Fix pg_dump so pg_upgrade'ing an extension with simple opfamilies works.
As reported by Michael Feld, pg_upgrade'ing an installation havingextensions with operator families that contain just a single operator classfailed to reproduce the extension membership of those operator families.This caused no immediate ill effects, but would create problems when latertrying to do a plain dump and restore, because the seemingly-not-part-of-the-extension operator families would appear separately in the pg_dumpoutput, and then would conflict with the families created by loading theextension. This has been broken ever since extensions were introduced,and many of the standard contrib extensions are affected, so it's a bitastonishing nobody complained before.The cause of the problem is a perhaps-ill-considered decision to omitsuch operator families from pg_dump's output on the grounds that theCREATE OPERATOR CLASS commands could recreate them, and having explicitCREATE OPERATOR FAMILY commands would impede loading the dump script intopre-8.3 servers. Whatever the merits of that decision when 8.3 was beingwritten, it looks like a poor tradeoff now. We can fix the pg_upgradeproblem simply by removing that code, so that the operator families aredumped explicitly (and then will be properly made to be part of theirextensions).Although this fixes the behavior of future pg_upgrade runs, it does nothingto clean up existing installations that may have improperly-linked operatorfamilies. Given the small number of complaints to date, maybe we don'tneed to worry about providing an automated solution for that; anyone whoneeds to clean it up can do so with manual "ALTER EXTENSION ADD OPERATORFAMILY" commands, or even just ignore the duplicate-opfamily errors theyget during a pg_restore. In any case we need this fix.Back-patch to all supported branches.Discussion: <20228.1460575691@sss.pgh.pa.us>1 parent6b93fcd commit6cead41
1 file changed
+1
-46
lines changedLines changed: 1 addition & 46 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
12489 | 12489 |
| |
12490 | 12490 |
| |
12491 | 12491 |
| |
12492 |
| - | |
12493 |
| - | |
12494 |
| - | |
| 12492 | + | |
12495 | 12493 |
| |
12496 | 12494 |
| |
12497 | 12495 |
| |
| |||
12777 | 12775 |
| |
12778 | 12776 |
| |
12779 | 12777 |
| |
12780 |
| - | |
12781 |
| - | |
12782 |
| - | |
12783 |
| - | |
12784 |
| - | |
12785 |
| - | |
12786 |
| - | |
12787 |
| - | |
12788 |
| - | |
12789 | 12778 |
| |
12790 | 12779 |
| |
12791 | 12780 |
| |
| |||
12868 | 12857 |
| |
12869 | 12858 |
| |
12870 | 12859 |
| |
12871 |
| - | |
12872 |
| - | |
12873 |
| - | |
12874 |
| - | |
12875 |
| - | |
12876 |
| - | |
12877 |
| - | |
12878 |
| - | |
12879 |
| - | |
12880 |
| - | |
12881 |
| - | |
12882 |
| - | |
12883 |
| - | |
12884 |
| - | |
12885 |
| - | |
12886 |
| - | |
12887 |
| - | |
12888 |
| - | |
12889 |
| - | |
12890 |
| - | |
12891 |
| - | |
12892 |
| - | |
12893 |
| - | |
12894 |
| - | |
12895 |
| - | |
12896 |
| - | |
12897 |
| - | |
12898 |
| - | |
12899 |
| - | |
12900 |
| - | |
12901 |
| - | |
12902 |
| - | |
12903 |
| - | |
12904 |
| - | |
12905 | 12860 |
| |
12906 | 12861 |
| |
12907 | 12862 |
| |
|
0 commit comments
Comments
(0)