orafce
orafce
orafce : Functions and operators that emulate a subset of functions and packages from the Oracle RDBMS
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 9100 | orafce
|
orafce
|
4.16.5 |
SIM
|
BSD 0-Clause
|
C
|
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
--s-d--
|
No
|
Yes
|
No
|
Yes
|
no
|
no
|
| Relationships | |
|---|---|
| See Also | oracle_fdw
pgtt
session_variable
pg_statement_rollback
pg_dbms_metadata
pg_dbms_lock
pg_dbms_job
db_migrator
|
el llvmjit deps break
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PGDG
|
4.16.5 |
18
17
16
15
14
|
orafce |
- |
| RPM | PGDG
|
4.16.5 |
18
17
16
15
14
|
orafce_$v |
- |
| DEB | PGDG
|
4.16.5 |
18
17
16
15
14
|
postgresql-$v-orafce |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
el8.x86_64
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
el8.aarch64
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
el9.x86_64
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
el9.aarch64
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
el10.x86_64
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
el10.aarch64
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
d12.x86_64
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
d12.aarch64
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
d13.x86_64
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
d13.aarch64
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
u22.x86_64
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
u22.aarch64
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
u24.x86_64
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
u24.aarch64
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
PGDG 4.16.5
|
Source
Install
Make sure PGDG repo available:
pig repo add pgdg -u # add pgdg repo and update cacheInstall this extension with pig:
pig install orafce; # install via package name, for the active PG version
pig install orafce -v 18; # install for PG 18
pig install orafce -v 17; # install for PG 17
pig install orafce -v 16; # install for PG 16
pig install orafce -v 15; # install for PG 15
pig install orafce -v 14; # install for PG 14Create this extension with:
CREATE EXTENSION orafce;Usage
Date Functions
SELECT add_months(date '2005-05-31', 1); -- 2005-06-30
SELECT last_day(date '2005-05-24'); -- 2005-05-31
SELECT next_day(date '2005-05-24', 'monday'); -- 2005-05-30
SELECT months_between(date '1995-02-02', date '1995-01-01'); -- 1.032...
SELECT trunc(date '2005-07-12', 'iw'); -- 2005-07-11
SELECT round(date '2005-07-12', 'yyyy'); -- 2006-01-01Oracle DATE Data Type
SET search_path TO oracle, "$user", public, pg_catalog;
CREATE TABLE t (col1 date);
INSERT INTO t VALUES('2014-06-24 12:12:11'::date); -- includes time componentString Functions (NVL, DECODE, etc.)
SELECT nvl('A', 'B'); -- A
SELECT nvl(NULL, 'B'); -- B
SELECT decode(1, 1, 'one', 2, 'two', 'other'); -- one
SELECT lnnvl(true); -- false
SELECT nanvl(0.0/0.0, 999); -- 999DUAL Table
SELECT * FROM dual;Package DBMS_OUTPUT
SELECT dbms_output.enable();
SELECT dbms_output.put_line('Hello');
SELECT dbms_output.get_line(line, status); -- retrieves outputPackage DBMS_PIPE
SELECT dbms_pipe.create_pipe('my_pipe');
SELECT dbms_pipe.pack_message('message text');
SELECT dbms_pipe.send_message('my_pipe');
-- In another session:
SELECT dbms_pipe.receive_message('my_pipe');
SELECT dbms_pipe.unpack_message_text();Package DBMS_ALERT
CALL dbms_alert.register('my_alert');
-- In another session:
CALL dbms_alert.signal('my_alert', 'Alert message');
-- Back in first session:
CALL dbms_alert.waitone('my_alert', name, message, status, 60);Package DBMS_UTILITY
SELECT dbms_utility.format_call_stack();Package UTL_FILE
CALL utl_file.fopen('/tmp', 'test.txt', 'w');
CALL utl_file.put_line(f, 'Hello World');
CALL utl_file.fclose(f);Package PLVstr / PLVchr
SELECT plvstr.left('Hello World', 5); -- Hello
SELECT plvstr.right('Hello World', 5); -- World
SELECT plvstr.rvrs('Hello'); -- olleH
SELECT plvchr.nth('Hello', 3); -- l
SELECT plvchr.first('Hello'); -- H
SELECT plvchr.last('Hello'); -- oPackage PLVsubst
SELECT plvsubst.string('My name is %s %s.', ARRAY['Pavel','Stehule']);
-- My name is Pavel Stehule.DBMS_ASSERT (SQL Injection Protection)
SELECT dbms_assert.enquote_literal('some value');
SELECT dbms_assert.schema_name('public');
SELECT dbms_assert.object_name('my_table');VARCHAR2 and NVARCHAR2 Types
The extension provides Oracle-compatible varchar2 and nvarchar2 data types that enforce the declared length in bytes (varchar2) or characters (nvarchar2).
Last updated on