migrating-oracle-to-postgres-stored-procedures

Converts Oracle PL/SQL stored procedures and functions to PostgreSQL PL/pgSQL equivalents.

38.5k|4.9k|Updated Jun 11, 2025
One-click install
npx skills add https://github.com/github/awesome-copilot --skill migrating-oracle-to-postgres-stored-procedures
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrating-oracle-to-postgres-stored-procedures
Source: https://github.com/github/awesome-copilot/tree/main/skills/migrating-oracle-to-postgres-stored-procedures
Command: npx skills add https://github.com/github/awesome-copilot --skill migrating-oracle-to-postgres-stored-procedures

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Migrating Oracle stored procedures to PostgreSQL requires manual translation of PL/SQL syntax, type handling, and collation behavior, which is error-prone and time-consuming when done by hand across large procedure libraries.

Core Features & Use Cases

  • Syntax Translation: Converts Oracle-specific PL/SQL constructs to PostgreSQL PL/pgSQL while preserving control flow, method signatures, and exception handling.
  • Type and Collation Handling: Keeps type-anchored input parameters, uses explicit types for output parameters, and applies deliberate collation mapping (COLLATE "C" or locale collations) based on Oracle sorting behavior.
  • orafce Integration: Leverages the orafce extension where it improves fidelity, and flags UNION ALL branches as query-plan review checkpoints.
  • Use Case: During a database migration, point the skill at your Oracle DDL directory and receive one PostgreSQL procedure file per source procedure, organized by package in the target project folder.

Quick Start

Migrate the Oracle stored procedures in my DDL/Oracle/Procedures and Functions folder to PostgreSQL PL/pgSQL and write each one to the Postgres output directory.

Frequently Asked Questions about migrating-oracle-to-postgres-stored-procedures

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate Oracle stored procedures to PostgreSQL?

Read each Oracle PL/SQL procedure from the source DDL directory, translate Oracle-specific syntax to PL/pgSQL equivalents, and write one file per procedure to the Postgres output folder. Preserve signatures, control flow, and exception handling throughout.

How are Oracle %TYPE anchored parameters handled in PostgreSQL?

Type-anchored input parameters like table_name.column_name%TYPE are preserved in the PostgreSQL output. Output parameters passed to other procedures use explicit types such as NUMERIC, VARCHAR, or INTEGER instead of type anchoring.

Does the migration support the orafce extension?

Yes, the orafce extension is leveraged when it improves clarity or fidelity of the translated procedure. It provides Oracle-compatible functions in PostgreSQL that reduce the amount of manual syntax rewriting needed.

How is Oracle NLS_SORT collation mapped to PostgreSQL?

COLLATE "C" is used only when Oracle-compatible binary ordering is required. Explicit linguistic sorts like NLS_SORT = French map to a PostgreSQL locale collation, discovered via the pg_collation catalog in the target environment.

What are the limitations of automated Oracle to PostgreSQL procedure conversion?

UNION ALL branches require manual query-plan review since combined-branch planning can cause regressions like unexpected sequential scans. The skill also does not generate COMMENT or GRANT statements, so permissions must be handled separately.