pg_dbms_lock
Extension to add Oracle DBMS_LOCK full compatibility to PostgreSQL
pg_dbms_lock : Extension to add Oracle DBMS_LOCK full compatibility to PostgreSQL
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 9250 | pg_dbms_lock | pg_dbms_lock | 2.0 |
SIM | PostgreSQL | SQL |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| ----d-- | No | No | No | Yes | no | no |
| Relationships | |
|---|---|
| Schemas | dbms_lock |
| Requires | pg_background |
| See Also | pg_dbms_job pg_dbms_metadata pg_utl_smtp pg_dbms_errlog orafce pg_cron pgagent pg_task |
Requires pg_background >= 2.0; the PIGSTY DEB carries a downstream pg_background v2 API compatibility patch.
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | MIXED | 2.0 |
18 17 16 15 14 | pg_dbms_lock |
pg_background |
| RPM | PGDG | 2.0 |
18 17 16 15 14 | pg_dbms_lock_$v |
pg_background_$v |
| DEB | PIGSTY | 2.0 |
18 17 16 15 14 | postgresql-$v-pg-dbms-lock |
postgresql-$v-pg-background |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PGDG 2.0 | PGDG 2.0 | PGDG 2.0 | PGDG 2.0 | PGDG 2.0 |
| el8.aarch64 | PGDG 2.0 | PGDG 2.0 | PGDG 2.0 | PGDG 2.0 | PGDG 2.0 |
| el9.x86_64 | PGDG 2.0 | PGDG 2.0 | PGDG 2.0 | PGDG 2.0 | PGDG 2.0 |
| el9.aarch64 | PGDG 2.0 | PGDG 2.0 | PGDG 2.0 | PGDG 2.0 | PGDG 2.0 |
| el10.x86_64 | PGDG 2.0 | PGDG 2.0 | PGDG 2.0 | PGDG 2.0 | PGDG 2.0 |
| el10.aarch64 | PGDG 2.0 | PGDG 2.0 | PGDG 2.0 | PGDG 2.0 | PGDG 2.0 |
| d12.x86_64 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 |
| d12.aarch64 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 |
| d13.x86_64 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 |
| d13.aarch64 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 |
| u22.x86_64 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 |
| u22.aarch64 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 |
| u24.x86_64 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 |
| u24.aarch64 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 |
| u26.x86_64 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 |
| u26.aarch64 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 | PIGSTY 2.0 |
Source
github.com/HexaCluster/pg_dbms_lock
pg_dbms_lock-2.0.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
pg_dbms_lock: Extension to add Oracle DBMS_LOCK full compatibility to PostgreSQL
Uses PostgreSQL advisory locks to emulate Oracle DBMS_LOCK behavior.
Enabling
ALLOCATE_UNIQUE
Allocate a unique lock identifier for a named lock:
REQUEST
Request a lock with a specific mode (Exclusive=6, Shared=4):
Return values: 0=Success, 1=Timeout, 3=Parameter error, 4=Already own lock, 5=Illegal handle.
RELEASE
Explicitly release a previously acquired lock:
SLEEP
Suspend the session for a given duration: