pgi 1.3.0 → 1.3.1
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 +7 -0
- data/VERSION +1 -1
- data/lib/pgi/connection.rb +10 -0
- 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: fed6426755c81717b19c965b3cdfb0063055d7a079a9422a7c63a1da6c0ea2f0
|
|
4
|
+
data.tar.gz: 16f727729774256b7dfa0de2f693d8ee324b7aa1702ef5a690fcce9778ec3e6e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: adaa23894959c446cfe97ac48624dc0f51be999bbfe9931d858225691fcee4ce01183bf7b79602e554d729e628f4947f746aff4a6c3b2ed69764c7c8928e1dc0
|
|
7
|
+
data.tar.gz: 6958c45e9efffec55b0f364f0d5ef50cad86bb0c2e63cc616608f6780fb9752be712b4742650f975b6cb1a30bf7dfa3c3345f50c5de58b972a6ed4e4390e2740
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 1.3.1 (2026-10-30)
|
|
4
|
+
|
|
5
|
+
- **A stale prepared statement is planned again** — `#exec_stmt` deallocates
|
|
6
|
+
and re-prepares a statement that Postgres refuses with `cached plan must not
|
|
7
|
+
change result type` (a `SELECT *` after an `ALTER TABLE` under a running
|
|
8
|
+
process) and retries once, instead of raising until the process restarts.
|
|
9
|
+
|
|
3
10
|
## 1.3.0 (2026-10-30)
|
|
4
11
|
|
|
5
12
|
- **A sort-only projection collision raises** — a read that sorts on a
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.3.
|
|
1
|
+
1.3.1
|
data/lib/pgi/connection.rb
CHANGED
|
@@ -56,12 +56,22 @@ module PGI
|
|
|
56
56
|
return @conn.exec_params(sql, params)
|
|
57
57
|
end
|
|
58
58
|
|
|
59
|
+
replanned = false
|
|
59
60
|
begin
|
|
60
61
|
@conn.exec_prepared(stmt_name, params)
|
|
61
62
|
rescue PG::InvalidSqlStatementName
|
|
62
63
|
@logger&.debug "Creating missing prepared statement: \"#{stmt_name}\""
|
|
63
64
|
@conn.prepare(stmt_name, sql)
|
|
64
65
|
retry
|
|
66
|
+
rescue PG::FeatureNotSupported => e
|
|
67
|
+
# The table changed shape under a running process (ALTER TABLE): plan again, once
|
|
68
|
+
raise if replanned || !e.message.include?("cached plan must not change result type")
|
|
69
|
+
|
|
70
|
+
@logger&.debug "Re-preparing stale statement: \"#{stmt_name}\""
|
|
71
|
+
@conn.exec("DEALLOCATE #{@conn.quote_ident(stmt_name)}")
|
|
72
|
+
@conn.prepare(stmt_name, sql)
|
|
73
|
+
replanned = true
|
|
74
|
+
retry
|
|
65
75
|
end
|
|
66
76
|
rescue PG::Error => e
|
|
67
77
|
# Log at the source so failures are traceable regardless of how the
|