plx 1.1
plx 1.1 adds plxcobol, a COBOL dialect (ISO/IEC 1989:2023, COBOL 2023, free
format), at full plpgsql construct parity. As with the other dialects, a COBOL
function body is transpiled to plpgsql at CREATE FUNCTION time and runs on the
standard plpgsql interpreter, with no separate language runtime in the backend.
plxcobol
COBOL is verb-driven and free-format, so it has its own front end (tokenizer and
recursive-descent parser). Data names map to plpgsql identifiers (lower-cased,
hyphens to underscores). Coverage:
WORKING-STORAGEdeclarations, withPICTUREmapped to SQL types, plusTYPE
(for%ROWTYPE,RECORD,refcursor) andCONSTANT AS.MOVE/COMPUTEand theADD/SUBTRACT/MULTIPLY/DIVIDEverbs;
**is exponent and%is modulo.IF/ELSE/END-IF;EVALUATE(simple and searchedEVALUATE TRUE).PERFORMin theUNTIL,VARYING,TIMES, inline, query (OVER "sql") and
array (OVER ARRAY) forms;EXIT PERFORM [CYCLE].GOBACK RETURNING,RETURN-NEXT,RETURN-QUERY;EXECUTEwithUSING/INTO;
cursors (OPEN-CURSOR/FETCH-CURSOR/MOVE-CURSOR/CLOSE-CURSOR).- Exception handling (
BEGIN-TRY/WHEN/END-TRY) with stacked diagnostics via
GET;GET ROW-COUNT;FOUND. STRING-APPEND <expr> TO <var>, which lowers to theplx_strbuildstring
builder (amortized-O(1) in-loop string building).RAISE,DISPLAY,ASSERT,CALL,COMMIT/ROLLBACK.
See doc/plxcobol.md
and the parity matrix in
doc/PARITY.md.
Performance
plxcobol transpiles to plpgsql like the other dialects, so it matches plpgsql on
the arithmetic, iteration, string-building, and call workloads; see
bench/BENCHMARKS.md.
Upgrading
Existing 1.0 installations upgrade in place:
ALTER EXTENSION plx UPDATE TO '1.1';A fresh CREATE EXTENSION plx installs 1.1 directly.
Compatibility
Tested against PostgreSQL 13 through 18; the full regression suite (nine suites,
including plxcobol) passes on each.