Commit 306826f
authored
[8.x] Fix issues with dumping PostgreSQL databases that contain multiple schemata (#36046)
* Eliminate the need for search_path logic
The PostgreSQL search_path logic that this commit removes was added with the intention of enabling support for a schema named anything other than "public". While the theory was sound, the implementation didn't take into account the behavior in databases in which *multiple* schemas exist. In multi-schema databases, the list of tables for which data should not be dumped was incorrect, leading to unexpected behavior.
This revised approach takes advantage of PostgreSQL's support for pattern-based object references when specifying the list of tables for which data should not be dumped, and eliminates the need to perform complex search_path parsing altogether.
The attendant Pull Request documentation explains how this technique works in detail.
* Re-implement pg_restore fix that was reverted
#36054 was fixed in a previous commit, but appears to have been lost during subsequent edits in 7be50a5 .
This commit restores the changes made in 502e75b .
Fixes #36054
* Fix PostgreSQL object reference pattern quoting
While not required in a psql interactive terminal, this pattern requires outer double-quotes to function as intended when passed as a CLI argument.
While simple in this specific instance, pattern quoting can grow complicated (depending on the pattern), but is well explained in the PostgreSQL manual:
https://www.postgresql.org/docs/current/app-psql.html#APP-PSQL-PATTERNS1 parent 15c1ddd commit 306826f
1 file changed
+3
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | 19 | | |
24 | 20 | | |
25 | 21 | | |
26 | 22 | | |
27 | | - | |
28 | | - | |
| 23 | + | |
| 24 | + | |
29 | 25 | | |
30 | 26 | | |
31 | 27 | | |
| |||
43 | 39 | | |
44 | 40 | | |
45 | 41 | | |
46 | | - | |
| 42 | + | |
47 | 43 | | |
48 | 44 | | |
49 | 45 | | |
| |||
0 commit comments