autoinc
functions for autoincrementing fields
autoinc : functions for autoincrementing fields
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 4881 | autoinc | autoinc | 1.0 |
FUNC | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-- | No | Yes | No | Yes | no | no |
| Relationships | |
|---|---|
| See Also | tcn refint insert_username moddatetime table_log |
Packages
| PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|
| 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
This is a built-in contrib extension ship with the PostgreSQL kernel
Install
Create this extension with:
Usage
Provides a trigger function that auto-increments specified columns using sequences.
Trigger Function
| Function | Description |
|---|---|
autoinc() |
Auto-increment columns from sequences on insert (and optionally update) |
Parameters are pairs of (column name, sequence name). The value is replaced only if initially zero or NULL.