plx 1.3.2
Code-only patch release (no catalog changes). Upgrade with ALTER EXTENSION plx UPDATE TO '1.3.2' after installing the new module.
Fixed
-
plxgo
fmt.Sprintf. In expression positionfmt.Sprintfpassed its Go format string straight into SQLformat(), which understands only%s,%I,%Land%%. Every other verb raisedunrecognized format() type specifierwhen the function was called. The transpile succeeded and the failure only appeared at run time, sofmt.Sprintf("%d", n), the ordinary way to format an integer in Go, produced a function that could not run. Go's verbs are now rewritten to the%sthatformat()understands, keeping a-flag and a width. A%that starts no directive is escaped rather than passed through, since a lone%is itself an error toformat().The verbs that change an operand's representation rather than its padding render what
%srenders, sofmt.Sprintf("%x", 255)yields255and notff. Convert explicitly where the representation matters. Recorded in the Go chapter and in the limitations page.
Added
make differentialcheck. Each case is one small program written once as a plpgsql reference and once per dialect, then called with the same arguments. The reference is the plpgsql a PostgreSQL developer would have written for the same logic, so a disagreement is a defect rather than a difference of opinion. Values are compared by text form with NULL distinguished from the empty string, and a case that raises must raise the same SQLSTATE. Intended divergences are recorded per case with a reason, and the check fails if a recorded divergence stops happening, so a documented limitation cannot outlive its documentation. This is what found theSprintfbug above.- A migration page, comparing plx against rewriting by hand, an embedded PL,
ora2pg, and leaving the logic in the application, including how to leave plx while keeping the generated plpgsql: https://commandprompt.github.io/plx/MIGRATION/
Changed
- The internal transpiler refactor behind a
PlxSurface.parse_bodyvtable, and its follow-up cleanups. No functional change; generated plpgsql is byte-identical.
Verification
CI green on PostgreSQL 13 through 18. On 18.4: clean build with no warnings, 13/13 installcheck, differentialcheck at 374 matching and 14 documented. ALTER EXTENSION plx UPDATE TO '1.3.2' from 1.3.1 applies and carries the fix, and a fresh CREATE EXTENSION plx installs 1.3.2.