forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6771c93
committed
Ensure schema qualification in pg_restore DISABLE/ENABLE TRIGGER commands.
Previously, this code blindly followed the common coding pattern ofpassing PQserverVersion(AH->connection) as the server-version parameterof fmtQualifiedId. That works as long as we have a connection; but inpg_restore with text output, we don't. Instead we got a zero fromPQserverVersion, which fmtQualifiedId interpreted as "server is too old tohave schemas", and so the name went unqualified. That still accidentallymanaged to work in many cases, which is probably why this ancient bug wentundetected for so long. It only became obvious in the wake of the changesto 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 thetime. We no longer support pg_dump from servers old enough to need theability to omit schema name, let alone restoring to them. (Also, the fewcallers outside pg_dump already didn't work with pre-schema servers.)In older branches, that's not an acceptable solution, so instead justtweak the DISABLE/ENABLE TRIGGER logic to ensure it will schema-qualifyits 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.org1 parente4597ee commit6771c93
File tree
7 files changed
+12
-24
lines changed- src
- bin
- pg_dump
- scripts
- fe_utils
- include/fe_utils
7 files changed
+12
-24
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1334 | 1334 |
| |
1335 | 1335 |
| |
1336 | 1336 |
| |
1337 |
| - | |
| 1337 | + | |
1338 | 1338 |
| |
1339 | 1339 |
| |
1340 | 1340 |
| |
|
Lines changed: 3 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
901 | 901 |
| |
902 | 902 |
| |
903 | 903 |
| |
904 |
| - | |
905 |
| - | |
906 |
| - | |
| 904 | + | |
907 | 905 |
| |
908 | 906 |
| |
909 | 907 |
| |
| |||
991 | 989 |
| |
992 | 990 |
| |
993 | 991 |
| |
994 |
| - | |
995 |
| - | |
996 |
| - | |
| 992 | + | |
997 | 993 |
| |
998 | 994 |
| |
999 | 995 |
| |
| |||
1019 | 1015 |
| |
1020 | 1016 |
| |
1021 | 1017 |
| |
1022 |
| - | |
1023 |
| - | |
1024 |
| - | |
| 1018 | + | |
1025 | 1019 |
| |
1026 | 1020 |
| |
1027 | 1021 |
| |
|
Lines changed: 1 addition & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
135 | 135 |
| |
136 | 136 |
| |
137 | 137 |
| |
138 |
| - | |
139 | 138 |
| |
140 | 139 |
| |
141 |
| - | |
142 |
| - | |
| 140 | + | |
143 | 141 |
| |
144 | 142 |
| |
145 | 143 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
356 | 356 |
| |
357 | 357 |
| |
358 | 358 |
| |
359 |
| - | |
360 |
| - | |
| 359 | + | |
361 | 360 |
| |
362 | 361 |
| |
363 | 362 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
406 | 406 |
| |
407 | 407 |
| |
408 | 408 |
| |
409 |
| - | |
410 |
| - | |
| 409 | + | |
411 | 410 |
| |
412 | 411 |
| |
413 | 412 |
| |
|
Lines changed: 4 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
138 | 138 |
| |
139 | 139 |
| |
140 | 140 |
| |
141 |
| - | |
142 |
| - | |
| 141 | + | |
143 | 142 |
| |
144 | 143 |
| |
145 | 144 |
| |
146 | 145 |
| |
147 | 146 |
| |
148 | 147 |
| |
149 | 148 |
| |
150 |
| - | |
| 149 | + | |
151 | 150 |
| |
152 | 151 |
| |
153 | 152 |
| |
154 | 153 |
| |
155 |
| - | |
156 |
| - | |
| 154 | + | |
| 155 | + | |
157 | 156 |
| |
158 | 157 |
| |
159 | 158 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
28 |
| - | |
29 |
| - | |
| 28 | + | |
30 | 29 |
| |
31 | 30 |
| |
32 | 31 |
| |
|
0 commit comments
Comments
(0)