forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6693c9d
committed
Fix pg_dump's handling of public schema with both -c and -C options.
Since -c plus -C requests dropping and recreating the target databaseas a whole, not dropping individual objects in it, we should assume thatthe public schema already exists and need not be created. The previouscoding considered only the state of the -c option, so it would emit"CREATE SCHEMA public" anyway, leading to an unexpected error in restore.Back-patch to 9.2. Older versions did not accept -c with -C so theissue doesn't arise there. (The logic being patched here dates to 8.0,cf commit2193121, so it's not really wrong that it didn't considerthe case at the time.)Note that versions before 9.6 will still attempt to emit REVOKE/GRANTon the public schema; but that happens without -c/-C too, and doesn'tseem to be the focus of this complaint. I considered extending thisstanza to also skip the public schema's ACL, but that would be amisfeature, as it'd break cases where users intentionally changed thatACL. The real fix for this aspect is Stephen Frost's work to not dumpbuilt-in ACLs, and that's not going to get back-ported.Per bugs #13804 and #14271. Solution found by David Johnston and laterrediscovered by me.Report: <20151207163520.2628.95990@wrigleys.postgresql.org>Report: <20160801021955.1430.47434@wrigleys.postgresql.org>1 parent3ca3594 commit6693c9d
1 file changed
+11
-4
lines changedLines changed: 11 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3008 | 3008 |
| |
3009 | 3009 |
| |
3010 | 3010 |
| |
3011 |
| - | |
3012 |
| - | |
| 3011 | + | |
| 3012 | + | |
| 3013 | + | |
| 3014 | + | |
| 3015 | + | |
| 3016 | + | |
| 3017 | + | |
| 3018 | + | |
| 3019 | + | |
| 3020 | + | |
3013 | 3021 |
| |
3014 |
| - | |
| 3022 | + | |
3015 | 3023 |
| |
3016 | 3024 |
| |
3017 | 3025 |
| |
3018 | 3026 |
| |
3019 |
| - | |
3020 | 3027 |
| |
3021 | 3028 |
| |
3022 | 3029 |
| |
|
0 commit comments
Comments
(0)