forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit16eff42
committed
Fix pg_dumpall to cope with dangling OIDs in pg_auth_members.
There is a race condition between "GRANT role" and "DROP ROLE",which allows GRANT to install pg_auth_members entries that refer todropped roles. (Commit6566133 prevented that for the grantorfield, but not for the granted or grantee roles.) We'll soon fixthat, at least in HEAD, but pg_dumpall needs to cope with thesituation in case of pre-existing inconsistency. As pg_dumpallstands, it will emit invalid commands like 'GRANT foo TO ""',which causes pg_upgrade to fail. Fix it to emit warnings and skipthose GRANTs, instead.There was some discussion of removing the problem by changingdumpRoleMembership's query to use JOIN not LEFT JOIN, but thatwould result in silently ignoring such entries. It seems betterto produce a warning.Pre-v16 branches already coped with dangling grantor OIDs by simplyomitting the GRANTED BY clause. I left that behavior as-is, althoughit's somewhat inconsistent with the behavior of later branches.Reported-by: Virender Singla <virender.cse@gmail.com>Discussion:https://postgr.es/m/CAM6Zo8woa62ZFHtMKox6a4jb8qQ=w87R2L0K8347iE-juQL2EA@mail.gmail.comBackpatch-through: 131 parent69c45ec commit16eff42
1 file changed
+57
-9
lines changedLines changed: 57 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
966 | 966 |
| |
967 | 967 |
| |
968 | 968 |
| |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
969 | 976 |
| |
970 | 977 |
| |
971 | 978 |
| |
| |||
975 | 982 |
| |
976 | 983 |
| |
977 | 984 |
| |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
978 | 989 |
| |
979 | 990 |
| |
980 | 991 |
| |
| |||
986 | 997 |
| |
987 | 998 |
| |
988 | 999 |
| |
989 |
| - | |
990 | 1000 |
| |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
991 | 1004 |
| |
992 | 1005 |
| |
993 | 1006 |
| |
| |||
996 | 1009 |
| |
997 | 1010 |
| |
998 | 1011 |
| |
999 |
| - | |
| 1012 | + | |
1000 | 1013 |
| |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
1001 | 1021 |
| |
1002 | 1022 |
| |
1003 | 1023 |
| |
| |||
1021 | 1041 |
| |
1022 | 1042 |
| |
1023 | 1043 |
| |
1024 |
| - | |
| 1044 | + | |
1025 | 1045 |
| |
1026 | 1046 |
| |
1027 | 1047 |
| |
1028 | 1048 |
| |
1029 | 1049 |
| |
1030 | 1050 |
| |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
1031 | 1060 |
| |
1032 | 1061 |
| |
1033 | 1062 |
| |
1034 | 1063 |
| |
1035 | 1064 |
| |
1036 |
| - | |
| 1065 | + | |
1037 | 1066 |
| |
1038 | 1067 |
| |
1039 | 1068 |
| |
1040 | 1069 |
| |
1041 |
| - | |
1042 | 1070 |
| |
1043 | 1071 |
| |
1044 | 1072 |
| |
| |||
1078 | 1106 |
| |
1079 | 1107 |
| |
1080 | 1108 |
| |
1081 |
| - | |
1082 |
| - | |
1083 |
| - | |
1084 |
| - | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
1085 | 1133 |
| |
1086 | 1134 |
| |
1087 | 1135 |
| |
|
0 commit comments
Comments
(0)