Skip to content

pg_ossie

Store and retrieve Ossie semantic model documents per schema

pg_ossie · Store and retrieve Ossie semantic model documents per schema

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
102474pg_ossiepg_ossie0.1.0FEATApache-2.0SQL

PostgreSQL · 13, 14, 15, 16, 17, 18, 19

Relationships
Requiresplpgsql

Usage

Sources:

pg_ossie 0.1.0 stores one Apache Ossie semantic-model document per schema as text. This reviewed source revision implements SQL and PL/pgSQL functions for PostgreSQL 13 or later. It does not generate business semantics or validate YAML.

Enable and inspect

Install the extension SQL files, then use an administrator to enable the fixed, nonrelocatable ossie schema:

CREATE EXTENSION pg_ossie;
SELECT ossie.validation_info();
SELECT ossie.export_comments('public');

The control file requires plpgsql; no shared library, preload or server restart is required. ossie.export_comments produces a starter document from catalog names, comments, columns, keys and foreign-key relationships. Review and validate that text externally before treating it as a model.

Store and retrieve

Keep the original validated YAML outside the database. In psql, supply its text through a variable:

SELECT ossie.set('public', :'validated_yaml', p_validated => true);
SELECT ossie.get('public');
SELECT * FROM ossie.list();
SELECT ossie.delete('public');

ossie.set replaces the document for the same schema name and updates its timestamp and author label. ossie.get returns NULL when no document exists; ossie.delete reports whether a row was deleted. The stored specification version defaults to 0.1.1, independently of the extension version.

Privileges and maintenance

Functions execute with caller privileges. Application roles need suitable schema, function and table privileges on ossie.documents; the reviewed script does not grant a general application access policy. p_updated_by is caller-supplied metadata, not an independently authenticated audit identity.

Without p_validated => true, writes emit a reminder to validate externally. SET ossie.warn_on_set = off also suppresses it; neither option performs validation. Keep independent document copies and verify backup coverage for the extension-owned table before upgrades or removal. Dropping the extension removes its stored objects.

Table reader