
Migrating Oracle To Postgres Stored Procedures
Convert Oracle PL/SQL procedures and functions to PostgreSQL PL/pgSQL during a repo-guided database migration.
Overview
Migrating Oracle to Postgres stored procedures is an agent skill for the Build phase that translates Oracle PL/SQL routines to PostgreSQL PL/pgSQL while preserving signatures and migration-folder conventions.
Install
npx skills add https://github.com/github/awesome-copilot --skill migrating-oracle-to-postgres-stored-proceduresWhat is this skill?
- Three-step workflow: read Oracle DDL, translate to PL/pgSQL, write outputs under the Postgres migration folder
- Preserves method signatures and table-anchored %TYPE parameters while using explicit types on outbound parameters
- Maps Oracle-specific syntax (REF CURSOR, sequences, exceptions) to PostgreSQL equivalents with orafce and COLLATE "C" wh
- Cross-checks Oracle table/view definitions in the migration tree for correct type resolution
- Keeps control flow and business logic aligned with the original procedure behavior
- 3-step workflow: read Oracle source, translate to PL/pgSQL, write Postgres output
Adoption & trust: 1.6k installs on skills.sh; 34.6k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You have Oracle procedures in a migration repo but no consistent, syntax-aware path to PostgreSQL equivalents that still match your tables and call chains.
Who is it for?
Backend developers or solo founders porting an Oracle workload who already maintain paired Oracle/Postgres DDL folders in the project.
Skip if: Greenfield Postgres-only apps, schema-only migrations with no stored logic, or teams that have not staged Oracle source DDL in the expected migration paths.
When should I use this skill?
Converting Oracle stored procedures or functions to PostgreSQL equivalents during a database migration.
What do I get? / Deliverables
You get PL/pgSQL procedure files written to the Postgres migration output tree, ready for review, risk screening, and integration testing against Oracle behavioral deltas.
- Translated PL/pgSQL procedure and function files in the Postgres migration output directory
- Preserved signatures and control flow relative to the Oracle source
Recommended Skills
Journey fit
Stored-procedure translation is core backend migration work, done while rebuilding or porting the data layer before ship. The skill targets server-side SQL routines, signatures, and types—not frontend, ops dashboards, or launch copy.
How it compares
Use for procedural translation inside a migration repo—not as a generic SQL linter or a one-shot chat rewrite without DDL context.
Common Questions / FAQ
Who is migrating-oracle-to-postgres-stored-procedures for?
Solo builders and small teams moving Oracle PL/SQL to PostgreSQL who want agent-guided translation tied to their migration DDL layout.
When should I use migrating-oracle-to-postgres-stored-procedures?
During Build when you are converting stored procedures and functions from the Oracle DDL folder to PostgreSQL equivalents, especially mid-migration before review and test hardening.
Is migrating-oracle-to-postgres-stored-procedures safe to install?
It is a procedural skill that reads and writes migration files in your workspace; review the Security Audits panel on this page and restrict filesystem access to trusted repos before running automated writes.
Workflow Chain
Requires first: reviewing oracle to postgres migration
Then invoke: reviewing oracle to postgres migration
SKILL.md
READMESKILL.md - Migrating Oracle To Postgres Stored Procedures
# Migrating Stored Procedures from Oracle to PostgreSQL Translate Oracle PL/SQL stored procedures and functions to PostgreSQL PL/pgSQL equivalents. ## Workflow ``` Progress: - [ ] Step 1: Read the Oracle source procedure - [ ] Step 2: Translate to PostgreSQL PL/pgSQL - [ ] Step 3: Write the migrated procedure to Postgres output directory ``` **Step 1: Read the Oracle source procedure** Read the Oracle stored procedure from `.github/oracle-to-postgres-migration/DDL/Oracle/Procedures and Functions/`. Consult the Oracle table/view definitions at `.github/oracle-to-postgres-migration/DDL/Oracle/Tables and Views/` for type resolution. **Step 2: Translate to PostgreSQL PL/pgSQL** Apply these translation rules: - Translate all Oracle-specific syntax to PostgreSQL equivalents. - Preserve original functionality and control flow logic. - Keep type-anchored input parameters (e.g., `PARAM_NAME IN table_name.column_name%TYPE`). - Use explicit types (`NUMERIC`, `VARCHAR`, `INTEGER`) for output parameters passed to other procedures — do not type-anchor these. - Do not alter method signatures. - Do not prefix object names with schema names unless already present in the Oracle source. - Leave exception handling and rollback logic unchanged. - Do not generate `COMMENT` or `GRANT` statements. - Use `COLLATE "C"` when ordering by text fields for Oracle-compatible sorting. - Leverage the `orafce` extension when it improves clarity or fidelity. Consult the PostgreSQL table/view definitions at `.github/oracle-to-postgres-migration/DDL/Postgres/Tables and Views/` for target schema details. **Step 3: Write the migrated procedure to Postgres output directory** Place each migrated procedure in its own file under `.github/oracle-to-postgres-migration/DDL/Postgres/Procedures and Functions/{PACKAGE_NAME_IF_APPLICABLE}/`. One procedure per file.