PL/SQL to PL/pgSQL coverage.
What Trekport translates from PL/SQL to PL/pgSQL. Items marked partial are reported by the engine with a concrete fix path before deployment.
Routines and packages
| Feature | Status | Notes |
|---|---|---|
| Standalone procedures and functions | Supported | — |
| Function default parameters | Supported | — |
| Functions with OUT parameters | Supported | Lowered to record-returning PL/pgSQL. |
| Package spec and body | Supported | Lowered to schema-plus-functions with state preserved. |
| Pipelined functions | Supported | — |
Triggers
| Feature | Status | Notes |
|---|---|---|
| Row-level triggers | Supported | — |
| Statement-level triggers | Supported | — |
| Compound triggers | Supported | — |
| INSTEAD OF triggers | Supported | — |
Cursors
| Feature | Status | Notes |
|---|---|---|
| Explicit cursors | Supported | — |
| Implicit cursors | Supported | — |
| REF CURSOR / SYS_REFCURSOR | Supported | — |
Control flow and bulk operations
| Feature | Status | Notes |
|---|---|---|
| Named exceptions and WHEN OTHERS | Supported | — |
| RAISE_APPLICATION_ERROR | Supported | — |
| BULK COLLECT INTO | Supported | — |
| FORALL | Supported | — |
| FORALL SAVE EXCEPTIONS | Supported | — |
| MERGE | Supported | — |
Queries and composite types
| Feature | Status | Notes |
|---|---|---|
| Hierarchical queries with CONNECT BY | Supported | — |
| Analytic and window functions | Supported | — |
| Object types and methods | Supported | — |
| Records and associative arrays | Supported | — |
Runtime packages
Runtime packages route through the compatibility layer. The engine never emits an Oracle package call without the supporting PostgreSQL extension being installed.
| Feature | Status | Notes |
|---|---|---|
| DBMS_OUTPUT, DBMS_LOB, DBMS_SQL | Supported | Through the compatibility layer. |
| UTL_FILE | Supported | Through the compatibility layer. |
| UTL_HTTP | Supported | Through the http extension. |
| DBMS_SCHEDULER and DBMS_JOB | Supported | Through pg_cron. |
Partial coverage
Trekport reports partial cases explicitly. The deployment report names the affected object and points at the resolution path.
| Feature | Status | Notes |
|---|---|---|
| Autonomous transactions | Partial | Limited equivalent via dblink for narrow cases. Engine reports gaps. |
| Database links to non-PostgreSQL targets | Partial | Targeted at PostgreSQL and foreign-data-wrapper-compatible sources. |
| Hints | Partial | Oracle hints carry forward as comments. Equivalent PostgreSQL plan controls applied where available. |
| FLASHBACK queries | Partial | Out-of-scope by default. Reported with rationale. |
Example: function with OUT parameters
Oracle sourceplsql
CREATE OR REPLACE FUNCTION lookup_employee(
p_emp_id IN employees.employee_id%TYPE,
p_name OUT employees.last_name%TYPE,
p_dept_id OUT employees.department_id%TYPE
) RETURN BOOLEAN AS
BEGIN
SELECT last_name, department_id
INTO p_name, p_dept_id
FROM employees
WHERE employee_id = p_emp_id;
RETURN TRUE;
EXCEPTION
WHEN NO_DATA_FOUND THEN RETURN FALSE;
END;PostgreSQL outputplpgsql
CREATE OR REPLACE FUNCTION lookup_employee(
p_emp_id integer,
OUT found boolean,
OUT p_name text,
OUT p_dept_id integer
) RETURNS record AS $$
BEGIN
SELECT last_name, department_id
INTO p_name, p_dept_id
FROM employees
WHERE employee_id = p_emp_id;
found := true;
EXCEPTION
WHEN NO_DATA_FOUND THEN found := false;
END;
$$ LANGUAGE plpgsql;
