refint
functions for implementing referential integrity (obsolete)
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
refint | 1.0 | FUNC | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 4880 | refint | No | Yes | No | Yes | No | No | - |
Version
| PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|
| 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
Install
Note: This is a built-in contrib extension of PostgreSQL
Usage
Provides trigger functions for implementing referential integrity checks (largely superseded by built-in foreign key constraints).
Trigger Functions
| Function | Description |
|---|---|
check_primary_key() | Check referencing table – ensures referenced row exists |
check_foreign_key() | Check referenced table – handles cascading actions on delete/update |
check_primary_key
Trigger on the referencing table (AFTER INSERT OR UPDATE). Parameters: referencing column name(s), referenced table name, referenced column name(s).
check_foreign_key
Trigger on the referenced table (AFTER DELETE OR UPDATE). Parameters: number of referencing tables, action (cascade, restrict, or setnull), primary key column(s), then referencing table and column pairs.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)