pgorafunc
pgora_builtin · Oracle compatibility functions and packages for PostgreSQL
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100645 | pgorafunc | pgora_builtin | 9.4 | SIM | AGPL-3.0 | C |
Usage
Sources:
pgorafunc supplies a subset of Oracle-compatible functions, operators, data types, and package-style APIs for PostgreSQL. It is primarily a migration aid for applications that expect familiar Oracle date behavior or packages such as dbms_output and utl_file; it is not a complete Oracle compatibility layer.
Core Workflow
Install the extension in the target database and put its oracle schema early enough in the session search path when unqualified Oracle-compatible names are required:
The search-path choice is material: the extension installs compatibility functions both in oracle and alongside built-in-visible names, and the README explicitly recommends the shown ordering for Oracle-style resolution. Schema-qualify calls in shared applications when changing a global search path would be unsafe.
Important Objects
oracle.datepreserves a time-of-day component and has Oracle-style arithmetic overloads.- Date helpers include
add_months,last_day,next_day,months_between,trunc,round, andto_date. Their accepted format models and rounding behavior should be tested against the migrated workload rather than assumed from PostgreSQL’s similarly named functions. dbms_outputprovides a session-local line queue with operations such asenable,put_line,get_line, andget_lines.utl_fileexposes server-side file operations, including opening, reading, writing, copying, renaming, and removing files.- Compatibility objects also include the
dualtable and additional Oracle-style packages documented by the project.
For session-local output, enable the queue, add lines, and then consume them:
Operational Notes
The control file declares version 9.4, a relocatable extension, and the module library, but no preload requirement or extension dependency. This is old, abandoned compatibility code; validate every required function and PostgreSQL-version combination before adopting it for a new migration.
Treat utl_file as a privileged server-side capability. Its operations run against files accessible to the PostgreSQL server process, so restrict who may execute them and test paths and permissions in a non-production environment. The dbms_output queue is session-local and disappears with the session. Existing Oracle applications may also depend on subtle implicit casts, locale rules, or package semantics outside the implemented subset.