Repository navigation
fix(ext): quote identifiers in pgsodium create_mask_view - #2672
Merged
brainrake merged 3 commits intoNov 18, 2026
Merged
Conversation
Build the generated trigger and function names with %I and pass the trigger body with %L, so table and column names are not spliced into the statement as raw text. Refs: SEC-1049 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
PostgreSQL Extension Dependency Analysis: PR #2672
SummaryNo extensions had dependencies with MAJOR version updates. Full Analysis ResultsPostgreSQL 15 Extension DependenciesPostgreSQL 17 Extension DependenciesOrioleDB 17 Extension Dependencies |
PostgreSQL Package Dependency Analysis: PR #2672
SummaryNo packages had MAJOR version updates. Full Analysis ResultsPostgreSQL 15 Dependency ChangesExtracting PostgreSQL 15 dependencies...
Runtime Closure Size
Raw Dependency ClosurePostgreSQL 17 Dependency ChangesExtracting PostgreSQL 17 dependencies...
Runtime Closure Size
Raw Dependency Closure |
Package version diffCompares built package versions in legacyPackages between this PR and the tip of the base branch, per system. aarch64-linux: Closure size: 73 -> 73 (2 paths added, 2 paths removed, delta +0, disk usage +0B).x86_64-linux: Closure size: 74 -> 74 (2 paths added, 2 paths removed, delta +0, disk usage +0B). |
Contributor
|
Question: do the third party extensions unit tests get run along with the patch in the build system? If not would probably be worth doing that. |
This comment has been minimized.
This comment has been minimized.
A restored project can pin pgsodium to an older installed version, so patch the 3.1.4--3.1.5 script as well. Build the trigger body from the upstream template so generated functions stay byte-identical for names that need no quoting. Refs: SEC-1049 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
brainrake
marked this pull request as ready for review
November 16, 2026 10:36
mmlb
enabled auto-merge
November 16, 2026 15:37
mmlb
approved these changes
Nov 16, 2026
mmlb
left a comment
Collaborator
There was a problem hiding this comment.
diff of diff is hard to read but the tests lgtm so ![]()
mmlb
disabled auto-merge
November 16, 2026 15:37
mmlb
requested changes
Nov 16, 2026
New installs always create pgsodium at the latest version, so the 3.1.6 to 3.1.7 script is the last one to define create_mask_view. Refs: SEC-1049 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
mmlb
approved these changes
Nov 17, 2026
brainrake
enabled auto-merge
November 18, 2026 17:20
brainrake
deleted the
martonboros/sec-1049-pgsodium-mask-view-quoting
branch
November 18, 2026 18:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
pgsodium.create_mask_view()builds trigger DDL withformat()and splices the table and column names in with%s. This patches the shipped upgrade script so the names go through%Iand the trigger body goes through%L.Changes
nix/ext/patches/pgsodium-create-mask-view-quoting.patch. It has one hunk, forsql/pgsodium--3.1.6--3.1.7.sql, the last script that defines the function. It applies to the latest pgsodium tree, the only one whose SQL scripts ship.pgsodiumpg_regress test with column names that contain"and$t$.Generated trigger and function names stay the same for names that need no quoting.
Scope
This covers
CREATE EXTENSION pgsodiumat the latest version, which is what new installs use. Older versions stay installable for restoring existing projects, and their scripts are unchanged. Databases that already have pgsodium keep the function body stored in their catalog.Testing
nix build .#checks.aarch64-darwin.psql_17 -Lruns pg_regress, includingnix/tests/sql/pgsodium.sql.nix build .#checks.aarch64-linux.ext-pgsodium -Lruns the extension VM test.create_mask_viewbody checksum.SEC-1049