
Oracle to PostgreSQL Migration
OfficialFreeSeamlessly convert Oracle stored procedures to PostgreSQL.
Free · Opens the source repo
What Oracle to PostgreSQL Migration does
Migrating stored procedures from Oracle to PostgreSQL can be a complex task due to differences in syntax and functionality. This skill provides a structured workflow to facilitate the translation of Oracle PL/SQL stored procedures into PostgreSQL PL/pgSQL equivalents. It ensures that the original functionality and control flow of the procedures are preserved while adapting them to the PostgreSQL environment.
The migration process involves reading the Oracle source procedure from a designated directory and translating it according to specific rules that handle Oracle-specific syntax. This includes maintaining method signatures, type-anchored parameters, and leveraging the orafce extension where beneficial. The skill also includes guidelines for handling collation mapping, ensuring that text ordering adheres to the appropriate linguistic requirements based on the original Oracle configurations.
Once the translation is complete, the migrated procedures are written to a specified output directory, with each procedure saved in its own file to maintain organization and clarity. This skill is particularly useful for database administrators and developers who are tasked with migrating legacy Oracle databases to PostgreSQL, providing them with a reliable method to automate much of the conversion process and reduce manual errors.
By following the outlined steps and rules, users can efficiently convert their Oracle stored procedures, minimizing the risk of functional discrepancies in the new PostgreSQL environment.
When to use it
Use this skill when migrating a database from Oracle to PostgreSQL, particularly when dealing with stored procedures and functions.
When not to use it
This skill is not suitable for migrating other database objects like tables or views, nor for non-stored procedure related migrations.
What you can build with it
Migrating a Legacy System
A company is transitioning from an Oracle database to PostgreSQL and needs to convert numerous stored procedures efficiently.
Automating Database Migration
A developer uses this skill to automate the migration of stored procedures, reducing manual effort and potential errors.
Ensuring Compatibility
During a database migration project, a team uses this skill to ensure that all Oracle PL/SQL procedures maintain their functionality in PostgreSQL.
How to install Oracle to PostgreSQL Migration
View source1. Install with the skills CLI
npx skills add github/awesome-copilot/migrating-oracle-to-postgres-stored-procedures --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by githubMigrating 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
COMMENTorGRANTstatements. - Apply collation intentionally when ordering text:
- Use
COLLATE "C"only when Oracle-compatible binary ordering is required and no other sort order is specified. - If Oracle used explicit linguistic sorting (for example
NLS_SORT = French), map to an explicit PostgreSQL locale collation instead of"C". - Use
SELECT collname, collprovider, collcollate, collctype FROM pg_collation ORDER BY collname;to discover collations in the target environment.
- Use
- Treat
UNION ALLas a review checkpoint. Validate plan quality per branch and restructure if combined-branch planning causes regressions (for example, unexpected sequential scans on large tables). - Leverage the
orafceextension 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.
Frequently asked questions about Oracle to PostgreSQL Migration
Similar skills
ClickHouse Logs Queries
Efficiently manage Supabase logs with ClickHouse SQL.
EF Core D2 Database Diagram Generator
Visualize your EF Core models as D2 diagrams effortlessly.
Safe SQL Execution
Ensure secure SQL execution in Supabase applications.
Oracle to PostgreSQL Migration
Identify migration risks between Oracle and PostgreSQL.
SSMA Console
Streamline Oracle to SQL Server migrations with ease.
SQL Performance Optimization
Enhance SQL query efficiency across all databases.
