APL ⎕SQL Interaction with Transactional DDL in PostgreSQL
23.5K reputation · 29 Jul 2020, 12:53 UTC
The goal is to determine whether changes made in an APL workspace can be safely rolled back after a data‑definition language (DDL) statement is issued through the ⎕SQL system function. This requires knowing if the workspace transaction remains open when the underlying DBMS processes the DDL.
Uncertainty arises because most relational databases issue an implicit commit when DDL runs, which would commit any prior workspace changes and prevent rollback. APL does not override this commit; the outcome therefore depends on whether the connected DBMS treats DDL as transactional, a property that varies by vendor, version, and session settings, and may differ across APL implementations such as Dyalog, GNU APL, and NARS2000.
Should APL automatically abort the workspace transaction when ⎕SQL detects that the DBMS performed an implicit commit due to DDL? Should the ⎕SQL function expose a status flag indicating whether the DBMS issued an implicit commit? Is it advisable to rely on DBMS‑specific configurations that make DDL transactional to achieve rollback safety across different APL dialects?