Native PostgreSQL Schema Script: postgres.sql - Infrastructure
This page documents schema objects parsed from config/sql/native/postgres.sql.
Region: Infrastructure
Schema, extensions, enum types, shared identifiers, repository metadata, and support routines.
Tables
m_assignment_holder
Abstract base table for assignment-holding objects, excluding shadows.
Represents AssignmentHolderType (all objects except shadows) extending m_object, but still abstract, hence the CHECK (false).
No indexes here, always add indexes and referential constraints on concrete sub-tables.
XSD type: http://midpoint.evolveum.com/xml/ns/public/common/common-3#AssignmentHolderType
Inherits from: m_object
No primary key is defined directly on this table. The table inherits from m_object.
Columns
| Column | Type | Required / constraints | Description |
|---|---|---|---|
|
|
required |
m_container
Abstract base table for separately persisted container values.
Purely abstract table (no entries are allowed). Represents Containerable/PrismContainerValue. Allows querying all separately persisted containers, but not necessary for the application.
No primary key is defined for this table.
Columns
| Column | Type | Required / constraints | Description |
|---|---|---|---|
|
|
required |
OID of the owning object row. Default OID value is covered by INSERT triggers. No PK defined on abstract tables. Owner does not have to be the direct parent of the container. |
|
|
required |
Container identifier unique within the owning object. Container ID, unique in the scope of the whole object (owner). While this provides it for sub-tables we will repeat this for clarity, it’s part of PK. |
m_object
Abstract base table containing common fields inherited by all repository object tables.
XSD type: http://midpoint.evolveum.com/xml/ns/public/common/common-3#ObjectType
No primary key is defined for this table.
Columns
| Column | Type | Required / constraints | Description |
|---|---|---|---|
|
|
required |
Object identifier inherited by concrete object tables. |
|
|
required |
Original object name as entered or displayed. |
|
|
required |
Normalized object name used for exact case-insensitive lookup and uniqueness. |
|
|
Serialized full object representation, however some items are stored separately. See Splitted full object for more information. |
|
|
|
OID of the tenant reference target object. |
|
|
|
Object type of the tenant reference target. |
|
|
|
Relation URI identifier of the tenant reference. |
|
|
|
||
|
|
required, default |
Next container identifier value allocated within this object. |
|
|
required, default |
Object version used for optimistic locking. |
|
|
Policy situation URI identifiers attached to the object. |
|
|
|
Object subtype values used for subtype filtering. |
|
|
|
Text search helper content derived from selected object data. |
|
|
|
Indexed extension and attribute values stored as JSON data. Extension items are stored as JSON key:value pairs, where key is m_ext_item.id (as string)
and values are stored as follows (this is internal and has no effect on how query is written): |
|
|
|
OID of the object that created this object. |
|
|
|
Object type of the object that created this object. |
|
|
|
Relation URI identifier for the creator reference. |
|
|
|
URI identifier of the channel that created the object. |
|
|
|
Time when the object was created. |
|
|
|
OID of the object that last modified this object. |
|
|
|
Object type of the object that last modified this object. |
|
|
|
Relation URI identifier for the modifier reference. |
|
|
|
URI identifier of the channel that last modified the object. |
|
|
|
Time when the object was last modified. |
|
|
|
required, default |
Database timestamp when this row was created. |
|
|
required, default |
Database timestamp when this row was last modified. |
m_object_oid
Provides generated object identifiers shared by all concrete object tables.
Columns
| Column | Type | Required / constraints | Description |
|---|---|---|---|
|
|
primary key, required, default |
Generated repository object identifier referenced by concrete object rows. |
m_reference
Abstract base table for object and container references.
No primary key is defined for this table.
Columns
| Column | Type | Required / constraints | Description |
|---|---|---|---|
|
|
required |
OID of the object that owns the reference. |
|
|
required |
Object type of the reference owner. |
|
|
required |
OID of the referenced target object. |
|
|
required |
Object type of the referenced target object. |
|
|
required |
Relation URI identifier of the reference. |
Foreign keys
| Column | References | Notes |
|---|---|---|
|
ON DELETE CASCADE |
|
|
- |
m_uri
Stores frequently used URI values, such as channels and relation QNames, as compact numeric identifiers.
Catalog of often used URIs, typically channels and relation Q-names. Never update values of "uri" manually to change URI for some objects (unless you really want to migrate old URI to a new one). URI can be anything, for QNames the format is based on QNameUtil ("prefix-url#localPart").
Columns
| Column | Type | Required / constraints | Description |
|---|---|---|---|
|
|
primary key, required |
Numeric URI identifier referenced by repository tables. |
|
|
required |
URI text value. |
Enum types
Enum types define allowed database values for selected columns.
Functions and procedures
Functions and procedures implement repository-side database behavior.
before_update_object
Prevents object OID changes and updates database-managed modification metadata.
Kind: function
delete_object_oid
Releases the shared OID row after a concrete object row is deleted.
Kind: function
insert_object_oid
Assigns a new OID to inserted object rows or reserves an explicitly provided OID.
Kind: function
Procedural blocks
Procedural blocks run repository-side setup logic that is documented as a whole.
do-block-1
Ensures UUID generation support by enabling pgcrypto when gen_random_uuid() is not already available.
Statement type: DO block
Used for: OID generation support
do-block-2
Adds the objectType discriminator column to m_object using PostgreSQL-version-specific generated-column behavior.
Statement type: DO block
Used for: PostgreSQL compatibility for inherited object type discriminator columns
do-block-3
Adds discriminator columns to m_reference and m_container using PostgreSQL-version-specific generated-column behavior.
Statement type: DO block
Used for: PostgreSQL compatibility for inherited reference and container discriminator columns
Extensions and schemas
Extensions and schemas are database infrastructure objects required by the repository schema.
Extension fuzzystrmatch
Enables fuzzy string matching functions used by repository search features.
Extension intarray
Enables indexing support for integer array columns used by repository search tables.
Extension pg_trgm
Enables trigram indexes used for efficient text search.
Schema CURRENT_USER
Creates the schema used by the native PostgreSQL repository objects for the current database user.