Skip to content

Move dbup-postgresql off the beta and pin Newtonsoft.Json - #31

Open
datadot wants to merge 2 commits into
drewburlingame:mainfrom
ANDDEV-OSS:fix/postgres-stable-and-newtonsoft
Open

datadot wants to merge 2 commits into
drewburlingame:mainfrom
ANDDEV-OSS:fix/postgres-stable-and-newtonsoft

Conversation

@datadot

@datadot datadot commented Sep 4, 2026

Copy link
Copy Markdown

Fixes #30.

Moves dbup-postgresql off the beta, which cannot parse $$-quoted function bodies, and pins Newtonsoft.Json away from CVE-2024-21907.

Why

6.0.0-beta.44 splits scripts on ; without honouring dollar-quoting, so any CREATE FUNCTION ... $$ ... ; ... $$ fails with 42601: unterminated dollar-quoted string. This is the beta risk noted in drwatson1#45 — stable dbup-postgresql (6.0.3, 6.1.2, 6.1.5, 7.0.1) is now published.

Changes

package from to why
dbup-postgresql 6.0.0-beta.44 6.1.5 the fix
dbup-core 6.0.4 6.1.1 6.1.5 needs >= 6.0.15, else CS1705 at compile
Npgsql 9.0.2 9.0.4 6.1.5 binds 9.0.4; without it the tool throws Could not load file or assembly 'Npgsql, Version=9.0.4.0' at runtime
dbup-mysql 6.0.4 6.1.0 keep the family aligned
dbup-sqlserver 6.0.0 6.0.16 keep the family aligned
Newtonsoft.Json (transitive 10.0.3) 13.0.3 CVE-2024-21907

The Newtonsoft.Json entry is a transitive pin only — nothing references it directly. It arrives via the deprecated Microsoft.Azure.KeyVault / Microsoft.Azure.Services.AppAuthentication, and CentralPackageTransitivePinningEnabled is already on, so the one line is enough. Replacing those two with Azure.Identity would be the better long-term fix, but that changes auth behaviour so I left it alone.

I chose 6.1.5 over 7.0.1 to stay within the 6.x line the rest of the packages are on.

Verification

Built and run against PostgreSQL 16 with a real migration set — 171 scripts, 42 of which use $$ function bodies:

  • before: 30 scripts, then 42601: unterminated dollar-quoted string
  • after: 171 scripts, Upgrade successful, 75 tables created
  • second run: idempotent — re-executes only the 10 runAlways scripts, journal steady at 161

Also confirmed provider assemblies still load lazily after the bump: deleting dbup-sqlserver.dll, dbup-mysql.dll, Microsoft.Data.SqlClient.dll, MySql.Data.dll and the Microsoft.Azure.* assemblies leaves a PostgreSQL migration running clean. Useful for anyone trimming a container image.

I have not run the repo's own test suite — it uses Testcontainers and I wasn't set up for it, so that's worth a CI run.

@datadot

datadot commented Sep 4, 2026

Copy link
Copy Markdown
Author

Superseded by #27 — I missed that PR before opening this one, apologies.

#27 (open since November) already makes the same dbup-postgresql 6.0.0-beta.446.1.5 move plus the matching dbup-core / dbup-mysql / dbup-sqlserver / Npgsql bumps, and goes further: it drops net9.0 (end of support May 2026) and updates the test packages.

I'd suggest merging #27 rather than this. What this PR adds that #27 doesn't is the reasoning#30 documents the $$-quoting bug with a reproduction, which is the concrete reason the beta bump matters. I've linked that from #27.

Happy to close this whenever you like; leaving it open only so #30 has something attached.

Picks up the remaining version bumps proposed in drewburlingame#27
by @dreik - CommandDotNet, JetBrains.Annotations, YamlDotNet,
System.Text.Encoding.CodePages, and the test packages - so this branch is a
superset rather than a competing subset.

FluentAssertions 8 renames BeLessOrEqualTo to BeLessThanOrEqualTo, which
ContainerTest needed.

Solution builds clean and all 111 unit tests pass on net8.0.
@datadot

datadot commented Sep 4, 2026

Copy link
Copy Markdown
Author

Update — retracting my "superseded, happy to close" above.

I've brought #27's version sweep into this branch, so it is no longer a subset of that PR. This one now carries all of the same bumps plus the dbup-postgresql beta fix that #30 documents, and #32 stacks the rest on top.

Full credit to @dreik — the bumps here are their list, and I took their net8.0;net10.0 choice over my original net8.0;net9.0;net10.0, since net9 is out of support.

Verified on this branch: solution builds with 0 warnings/0 errors, all 111 unit tests pass, and a real 171-script PostgreSQL migration runs clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dbup-postgresql beta breaks $$-quoted function bodies (stable is now available)

1 participant