plisql
PL/iSQL procedural language
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
ivorysql | 1.0 | SIM | Apache-2.0 | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 9140 | ivorysql_ora | No | Yes | No | Yes | No | No | sys |
| 9150 | ora_btree_gin | No | Yes | No | Yes | Yes | No | sys |
| 9160 | ora_btree_gist | No | Yes | No | Yes | Yes | No | sys |
| 9170 | pg_get_functiondef | No | Yes | No | Yes | Yes | No | - |
| 9180 | plisql | No | Yes | No | Yes | Yes | No | pg_catalog |
| 9190 | gb18030_2022 | No | Yes | No | Yes | Yes | No | pg_catalog |
from src/pl/plisql/src/plisql.control and IvorySQL package metadata
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.0 | 1817161514 | ivorysql | - |
| RPM | PIGSTY | 5.1 | 1817161514 | ivorysql5 | - |
| DEB | PIGSTY | 5.1 | 1817161514 | ivorysql-5 | - |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS |
| el8.aarch64 | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS |
| el9.x86_64 | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS |
| el9.aarch64 | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS |
| el10.x86_64 | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS |
| el10.aarch64 | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS |
| d12.x86_64 | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS |
| d12.aarch64 | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS |
| d13.x86_64 | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS |
| d13.aarch64 | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS |
| u22.x86_64 | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS |
| u22.aarch64 | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS |
| u24.x86_64 | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS |
| u24.aarch64 | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS |
Install
You can install ivorysql directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
pig repo add pgsql -u # Add repo and update cache
Install the extension using pig or apt/yum/dnf:
pig install ivorysql; # Install for current active PG version
pig ext install -y ivorysql -v 18 # PG 18
dnf install -y ivorysql5 # PG 18
apt install -y ivorysql-5 # PG 18
Create Extension:
CREATE EXTENSION plisql;
Usage
PL/iSQL is an Oracle-compatible procedural language for PostgreSQL, provided by the IvorySQL project. It extends PL/pgSQL with Oracle PL/SQL syntax and semantics.
Enabling
CREATE EXTENSION plisql;
Creating Functions
CREATE OR REPLACE FUNCTION hello_world
RETURN VARCHAR2
AS
BEGIN
RETURN 'Hello, World!';
END;
/
Oracle-Style Procedures
CREATE OR REPLACE PROCEDURE update_salary(
p_emp_id IN NUMBER,
p_amount IN NUMBER
)
AS
BEGIN
UPDATE employees SET salary = salary + p_amount WHERE emp_id = p_emp_id;
END;
/
CALL update_salary(100, 5000);
Key Features
- Oracle-style
BEGIN...ENDblocks IN,OUT,IN OUTparameter modes- Oracle-style exception handling with named exceptions
%TYPEand%ROWTYPEattribute references- Oracle-compatible cursor syntax (
CURSOR...IS,OPEN,FETCH,CLOSE) RETURNinstead ofRETURNSin function declarations- Package-like variable scoping
Differences from PL/pgSQL
- Uses
ASkeyword instead of$$delimiters - Supports Oracle-style
/as statement terminator VARCHAR2,NUMBER, and other Oracle types natively supported- Oracle-compatible
DBMS_OUTPUTintegration
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.