Repository navigation
Adds two dialects: plxlua (Lua) and plxcsharp (C#). Nothing that 3.0.0 does changes: functions in the other dialects transpile exactly as before.
Upgrading from 3.0.0
You need superuser access to each database that has plx.
-
Install the new build on the server.
-
Restart the server, or start new sessions, so that they load the new build.
-
In each database that has plx, run:
ALTER EXTENSION plx UPDATE;The update adds the two languages and their handler functions, and changes no existing object.
From 2.0.0, the same command updates through 3.0.0 to 3.1.0; read the 3.0.0 release notes first.
The new dialects
- plxlua:
- Lua's blocks,
localwith type inference and--::annotations, and every loop form: numericfor,ipairs,query(...),whileandrepeat. pcall/errorfor exceptions, and a subset of thestring,mathandtablelibraries.- Block-scoped locals.
- See doc/plxlua.md.
- Lua's blocks,
- plxcsharp:
- Type-first declarations and C# string forms, including interpolated strings that bind their values in SQL.
try/catch/finallywith exception classes andwhenfilters.- Switch expressions,
foreachover queries and arrays,yield return,StringBuilder, and a set of mapped .NET members. - See doc/plxcsharp.md.
Both run as TRUSTED languages and follow 3.0.0's rules:
- interpolated values are bound as parameters;
- plx's objects are schema-qualified;
- USAGE on plpgsql is required;
- declared types are checked;
- nesting, interrupts and string quoting are guarded.
Each chapter's "Semantic differences" section lists where a result differs from real Lua or C#.
Verification
- CI: green on PostgreSQL 13 through 18.
- Locally:
- 26/26 installcheck;
- the differential check with no unexplained divergence;
- 300/300
finallycases for plxpython3 and for plxcsharp; - 39/39 corpus programs;
make upgradecheck, including 3.0.0 to 3.1.0 matching a fresh install;- a new
make oraclecheck, which compares 55 Lua and C# programs with the output of reallua5.4and .NET 8; - fuzzing with no crash.
- Review: eight rounds of adversarial review; the last found no correctness defect.