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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8b734fe407ce3c430c3197b04db275df36640849f6795d7636614d8fab0c6574
4
- data.tar.gz: 4be4a94e18f929ef13c97072248e4c7b7e867ad80160841a81c0146a929b9e21
3
+ metadata.gz: b7ec13ebd9e8deb6ea3ea1f6d367f128b6bc2e78de3a8198a5d29701a8b4ac73
4
+ data.tar.gz: 243692b89d2972829ddaf9067a0bd3fe8372b693cbbcfcd09db12d17c363bac6
5
5
  SHA512:
6
- metadata.gz: cdb946b9f0b3ae2bfca4aa74aca93454cbc0ae6f332f0900216c3a35be9d8bdcef2b2082744bcc6262b6bc9cf72afae9a477c85f7e00d60da8d6eaa4ed55b825
7
- data.tar.gz: 12f63468a2d834e558b98e73937e739aa2ab4581cf83699e0a675e280cfd6e6f158d136156400e3ec7c7672beaa63189a6e90c727cc1c87281412e061c72b417
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 two "cannot provide it here"
90
- # cases feature_not_supported (0A000, binaries absent) and
91
- # invalid_schema_name (3F000, required schema absent) — and re-raises them
92
- # as a WARNING so the skip surfaces in the restore logs. insufficient_
93
- # privilege (42501) is deliberately NOT caught: a restore role lacking
94
- # CREATE privilege is a misconfiguration to fix, not to skip silently.
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Exwiw
4
- VERSION = "0.9.9"
4
+ VERSION = "0.9.10"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exwiw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.9
4
+ version: 0.9.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shia