pllua
Lua as a procedural language
Overview
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 3020 | pllua | No | Yes | No | Yes | No | No | pg_catalog |
| 3021 | hstore_pllua | No | Yes | No | Yes | No | Yes | - |
| 3030 | plluau | No | Yes | No | Yes | No | No | pg_catalog |
| 3031 | hstore_plluau | No | Yes | No | Yes | No | Yes | pg_catalog |
| Related | plv8 pljs plperl plperlu pgwasm plpython3u pltcl pg_tle |
|---|---|
| Depended By | hstore_pllua |
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | MIXED | 2.0.12 | 1817161514 | pllua | - |
| RPM | PIGSTY | 2.0.12 | 1817161514 | pllua_$v | - |
| DEB | PGDG | 2.0.12 | 1817161514 | postgresql-$v-pllua | - |
Install
You can install pllua directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Install
pig
dnf
apt
Create Extension:
Usage
pllua enables writing PostgreSQL functions in Lua (5.3, 5.4, or LuaJIT 2.1).
Create Functions
Data Type Handling
Arguments are automatically converted: integers/floats to Lua numbers, text/varchar to strings, booleans to Lua booleans, NULL to nil. Other types remain as datum objects.
Construct typed values with pgtype:
Composite Types (Rows)
Set-Returning Functions
SPI Database Access
Cursors
Trigger Functions
Trigger fields: trigger.event (INSERT/UPDATE/DELETE), trigger.when (BEFORE/AFTER), trigger.level (ROW/STATEMENT), trigger.new, trigger.old, trigger.row.
Error Handling
Logging
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)