Migrate Oracle Stored Procedures to PostgreSQL

Migrate Oracle Stored Procedures to PostgreSQL

Translates Oracle PL/SQL stored procedures to PostgreSQL PL/pgSQL, keeping signatures and type-anchored parameters and mapping collations explicitly.

Skill files1 file
SKILL.md49 lines
1
---
2
name: migrating-oracle-to-postgres-stored-procedures
3
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 explicit collation mapping (`COLLATE "C"` only when appropriate, locale collations when required). Use when converting Oracle stored procedures or functions to PostgreSQL equivalents during a database migration.'
4
---
5
6
# Migrating Stored Procedures from Oracle to PostgreSQL
7
8
Translate Oracle PL/SQL stored procedures and functions to PostgreSQL PL/pgSQL equivalents.
9
10
## Workflow
11
12
```
13
Progress:
14
- [ ] Step 1: Read the Oracle source procedure
15
- [ ] Step 2: Translate to PostgreSQL PL/pgSQL
16
- [ ] Step 3: Write the migrated procedure to Postgres output directory
17
```
18
19
**Step 1: Read the Oracle source procedure**
20
21
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.
22
23
**Step 2: Translate to PostgreSQL PL/pgSQL**
24
25
Apply these translation rules:
26
27
- Translate all Oracle-specific syntax to PostgreSQL equivalents.
28
- Preserve original functionality and control flow logic.
29
- Keep type-anchored input parameters (e.g., `PARAM_NAME IN table_name.column_name%TYPE`).
30
- Use explicit types (`NUMERIC`, `VARCHAR`, `INTEGER`) for output parameters passed to other procedures — do not type-anchor these.
31
- Do not alter method signatures.
32
- Do not prefix object names with schema names unless already present in the Oracle source.
33
- Leave exception handling and rollback logic unchanged.
34
- Do not generate `COMMENT` or `GRANT` statements.
35
- Apply collation intentionally when ordering text:
36
- Use `COLLATE "C"` only when Oracle-compatible binary ordering is required and no other sort order is specified.
37
- If Oracle used explicit linguistic sorting (for example `NLS_SORT = French`), map to an explicit PostgreSQL locale collation instead of `"C"`.
38
- Use `SELECT collname, collprovider, collcollate, collctype FROM pg_collation ORDER BY collname;` to discover collations in the target environment.
39
- Treat `UNION ALL` as a review checkpoint. Validate plan quality per branch and restructure if combined-branch planning causes regressions (for example, unexpected sequential scans on large tables).
40
- Leverage the `orafce` extension when it improves clarity or fidelity.
41
42
Consult the PostgreSQL table/view definitions at `.github/oracle-to-postgres-migration/DDL/Postgres/{ProjectName}/Tables and Views/` for target schema details.
43
44
**Step 3: Write the migrated procedure to Postgres output directory**
45
46
Place each migrated procedure in its own file under `.github/oracle-to-postgres-migration/DDL/Postgres/{ProjectName}/Procedures and Functions/{PACKAGE_NAME_IF_APPLICABLE}/`. One procedure per file.
47
48
> `{ProjectName}` is the project's assembly/folder name with spaces normalized to `-` (e.g. `MyApp.DataAccess`). This matches the path used by the agent and other migration skills.
49

© GitHub, Inc. · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…