PluginBench
Skill
Official
Review
Audit score 70

migrating-oracle-to-postgres-stored-procedures

github/awesome-copilot

Migrate Oracle PL/SQL stored procedures to PostgreSQL PL/pgSQL with syntax translation and Oracle-compatible collation.

What is migrating-oracle-to-postgres-stored-procedures?

Translates Oracle PL/SQL stored procedures and functions to PostgreSQL PL/pgSQL equivalents during database migration. Handles Oracle-specific syntax, preserves type-anchored parameters, applies COLLATE "C" for text sorting compatibility, and leverages the orafce extension where appropriate.

  • Translates Oracle PL/SQL syntax to PostgreSQL PL/pgSQL equivalents
  • Preserves original method signatures and type-anchored input parameters
  • Applies COLLATE "C" for Oracle-compatible text field sorting
  • Leverages orafce extension for improved clarity and fidelity
  • Maintains exception handling and rollback logic from source procedures
  • Resolves types using Oracle and PostgreSQL table/view definitions

How to install migrating-oracle-to-postgres-stored-procedures

npx skills add https://github.com/github/awesome-copilot --skill migrating-oracle-to-postgres-stored-procedures
Prerequisites
  • Access to Oracle source procedure files in `.github/oracle-to-postgres-migration/DDL/Oracle/Procedures and Functions/`
  • Oracle table/view definitions available at `.github/oracle-to-postgres-migration/DDL/Oracle/Tables and Views/`
  • PostgreSQL target schema definitions at `.github/oracle-to-postgres-migration/DDL/Postgres/Tables and Views/`
  • orafce extension installed in target PostgreSQL database (optional but recommended)
Claude Code
Cursor
Windsurf
Cline

How to use migrating-oracle-to-postgres-stored-procedures

  1. 1.Read the Oracle stored procedure from the Oracle source directory, consulting table/view definitions for type resolution
  2. 2.Apply translation rules: convert Oracle syntax to PL/pgSQL, preserve signatures and type-anchored input parameters, use explicit types for output parameters, apply COLLATE "C" for text ordering, and leverage orafce where beneficial
  3. 3.Write the migrated procedure to `.github/oracle-to-postgres-migration/DDL/Postgres/Procedures and Functions/{PACKAGE_NAME_IF_APPLICABLE}/` with one procedure per file

Use cases

Good for
  • Converting Oracle stored procedures to PostgreSQL during full database migration
  • Translating Oracle functions with type-anchored parameters to PL/pgSQL equivalents
  • Ensuring Oracle-compatible text sorting behavior in PostgreSQL procedures
  • Migrating packages of related procedures while preserving their organization
  • Handling complex control flow and exception logic in legacy Oracle procedures
Who it's for
  • Database migration engineers
  • Oracle-to-PostgreSQL conversion teams
  • DBAs managing legacy system transitions
  • Backend developers maintaining migrated codebases

migrating-oracle-to-postgres-stored-procedures FAQ

Should I type-anchor output parameters passed to other procedures?

No. Use explicit types (NUMERIC, VARCHAR, INTEGER) for output parameters. Only type-anchor input parameters using the %TYPE syntax.

When should I use COLLATE "C"?

Apply COLLATE "C" when ordering by text fields to maintain Oracle-compatible sorting behavior in PostgreSQL.

Should I include schema prefixes in object names?

No, unless they were already present in the original Oracle source. Do not add new schema prefixes during migration.

Can I generate COMMENT or GRANT statements?

No. Focus only on the procedure logic translation. Do not generate COMMENT or GRANT statements.

When should I use the orafce extension?

Leverage orafce when it improves clarity or fidelity of the migration, such as for Oracle-specific functions that have direct orafce equivalents.

Full instructions (SKILL.md)

Source of truth, from github/awesome-copilot.


name: migrating-oracle-to-postgres-stored-procedures description: 'Migrates Oracle PL/SQL stored procedures to PostgreSQL PL/pgSQL. Translates Oracle-specific syntax, preserves method signatures and type-anchored parameters, leverages orafce where appropriate, and applies COLLATE "C" for Oracle-compatible text sorting. Use when converting Oracle stored procedures or functions to PostgreSQL equivalents during a database migration.'

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.