exwiw 0.9.9 → 0.9.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/exwiw/ddl_postprocessor.rb +13 -7
- data/lib/exwiw/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b7ec13ebd9e8deb6ea3ea1f6d367f128b6bc2e78de3a8198a5d29701a8b4ac73
|
|
4
|
+
data.tar.gz: 243692b89d2972829ddaf9067a0bd3fe8372b693cbbcfcd09db12d17c363bac6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 42423c759d8df30b1586e15f6545f23bce5f9660e2687bc86956ad9da4f826e656ba474ab82c0613cf64cc43f1ff601d8c4dbbaf99582ddd6dc6562fc6a6b316
|
|
7
|
+
data.tar.gz: 45e029e21bd8c86d55cc8ec7287b9d06405bc1d19d02db5a3255b4f0fe0af07a5f25ab164eebc31fbed5a60544ce2d17152e71eb61c4f93de281707f046b929a
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.9.10] - 2026-07-09
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- **A whole-database schema restore no longer aborts when a preload-required extension (e.g. pglogical) is absent on the target.** `wrap_create_extension_in_do_block` already skipped a `CREATE EXTENSION` the target cannot provide for `feature_not_supported` (0A000) and `invalid_schema_name` (3F000), but an extension that must be loaded via `shared_preload_libraries` raises a bare `elog(ERROR, "<name> is not in shared_preload_libraries")`, which carries the default SQLSTATE `XX000` (`internal_error`) — not caught, so the whole `insert-000-schema.sql` restore aborted (observed restoring a pglogical-carrying production dump into a plain RDS mirage target). `internal_error` is now caught alongside the other two and re-raised as a WARNING, so the extension is skipped and the restore continues. `insufficient_privilege` (42501) is still deliberately NOT caught.
|
|
10
|
+
|
|
5
11
|
## [0.9.9] - 2026-07-09
|
|
6
12
|
|
|
7
13
|
### Changed
|
|
@@ -86,12 +86,18 @@ module Exwiw
|
|
|
86
86
|
# A bare `CREATE EXTENSION ...;` (as a full-database pg_dump emits, unlike a
|
|
87
87
|
# `--table` dump, which omits extensions) has no graceful skip: a restore
|
|
88
88
|
# target that cannot create the extension aborts the whole restore. Wrap
|
|
89
|
-
# each in a DO block that catches only the
|
|
90
|
-
#
|
|
91
|
-
#
|
|
92
|
-
#
|
|
93
|
-
#
|
|
94
|
-
#
|
|
89
|
+
# each in a DO block that catches only the "cannot provide it here" cases and
|
|
90
|
+
# re-raises them as a WARNING so the skip surfaces in the restore logs:
|
|
91
|
+
# - feature_not_supported (0A000, binaries absent)
|
|
92
|
+
# - invalid_schema_name (3F000, required schema absent)
|
|
93
|
+
# - internal_error (XX000): an extension that must be preloaded via
|
|
94
|
+
# shared_preload_libraries raises a bare `elog(ERROR, "<name> is not in
|
|
95
|
+
# shared_preload_libraries")` (default SQLSTATE XX000) when it is not
|
|
96
|
+
# preloaded on the target — e.g. pglogical restored into a plain RDS. Like
|
|
97
|
+
# the other two, this is the target being unable to provide the extension,
|
|
98
|
+
# not a broken dump, so the restore should skip it rather than abort.
|
|
99
|
+
# insufficient_privilege (42501) is deliberately NOT caught: a restore role
|
|
100
|
+
# lacking CREATE privilege is a misconfiguration to fix, not to skip silently.
|
|
95
101
|
CREATE_EXTENSION_RE = /^[ \t]*CREATE\s+EXTENSION\b(?:\s+IF\s+NOT\s+EXISTS)?\s+(?<name>"[^"]+"|[^\s;]+)[^;]*;/i.freeze
|
|
96
102
|
|
|
97
103
|
def wrap_create_extension_in_do_block(sql)
|
|
@@ -101,7 +107,7 @@ module Exwiw
|
|
|
101
107
|
warning = "exwiw: skipped CREATE EXTENSION #{extname} (SQLSTATE %): %"
|
|
102
108
|
warning_literal = "'#{warning.gsub("'", "''")}'"
|
|
103
109
|
"DO $$ BEGIN #{stmt} " \
|
|
104
|
-
"EXCEPTION WHEN feature_not_supported OR invalid_schema_name THEN " \
|
|
110
|
+
"EXCEPTION WHEN feature_not_supported OR invalid_schema_name OR internal_error THEN " \
|
|
105
111
|
"RAISE WARNING #{warning_literal}, SQLSTATE, SQLERRM; END $$;"
|
|
106
112
|
end
|
|
107
113
|
end
|
data/lib/exwiw/version.rb
CHANGED