pg_dbms_lock
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_dbms_lock | 2.0 | SIM | PostgreSQL | SQL |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 9250 | pg_dbms_lock | No | No | No | Yes | No | No | dbms_lock |
| Related | pg_background 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.
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | MIXED | 2.0 | 1817161514 | pg_dbms_lock | pg_background |
| RPM | PGDG | 2.0 | 1817161514 | pg_dbms_lock_$v | pg_background_$v |
| DEB | PIGSTY | 2.0 | 1817161514 | postgresql-$v-pg-dbms-lock | postgresql-$v-pg-background |
Build
You can build the DEB packages for pg_dbms_lock using pig build:
Install
You can install pg_dbms_lock directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Create Extension:
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:
Complete Example
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)