meta
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_meta | 0.4.0 | STAT | BSD 2-Clause | SQL |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 6430 | meta | No | No | No | Yes | No | Yes | - |
| Related | pg_profile pg_tracing pg_show_plans pg_stat_kcache pg_stat_monitor pg_qualstats pg_store_plans pg_track_settings |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.4.0 | 1817161514 | pg_meta | - |
| RPM | PIGSTY | 0.4.0 | 1817161514 | pg_meta_$v | - |
| DEB | PIGSTY | 0.4.0 | 1817161514 | postgresql-$v-pg-meta | - |
Build
You can build the RPM / DEB packages for pg_meta using pig build:
pig build pkg pg_meta # build RPM / DEB packages
Install
You can install pg_meta directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
pig repo add pgsql -u # Add repo and update cache
Install the extension using pig or apt/yum/dnf:
pig install pg_meta; # Install for current active PG version
pig ext install -y pg_meta -v 18 # PG 18
pig ext install -y pg_meta -v 17 # PG 17
pig ext install -y pg_meta -v 16 # PG 16
pig ext install -y pg_meta -v 15 # PG 15
pig ext install -y pg_meta -v 14 # PG 14
dnf install -y pg_meta_18 # PG 18
dnf install -y pg_meta_17 # PG 17
dnf install -y pg_meta_16 # PG 16
dnf install -y pg_meta_15 # PG 15
dnf install -y pg_meta_14 # PG 14
apt install -y postgresql-18-pg-meta # PG 18
apt install -y postgresql-17-pg-meta # PG 17
apt install -y postgresql-16-pg-meta # PG 16
apt install -y postgresql-15-pg-meta # PG 15
apt install -y postgresql-14-pg-meta # PG 14
Create Extension:
CREATE EXTENSION meta;
Usage
meta provides a normalized, human-friendly system catalog with common names for views and columns, sitting on top of pg_catalog and information_schema.
System Catalog Views
The extension creates approximately 30 views in the meta schema:
-- List all tables
SELECT * FROM meta.table;
-- List all columns
SELECT * FROM meta.column;
-- List all views
SELECT * FROM meta.view;
-- List schemas
SELECT * FROM meta.schema;
-- List functions
SELECT * FROM meta.function;
-- List extensions
SELECT * FROM meta.extension;
-- List triggers
SELECT * FROM meta.trigger;
-- List foreign keys
SELECT * FROM meta.foreign_key;
-- List constraints
SELECT * FROM meta.constraint_check;
SELECT * FROM meta.constraint_unique;
-- List types
SELECT * FROM meta.type;
-- List roles
SELECT * FROM meta.role;
-- List sequences
SELECT * FROM meta.sequence;
-- List operators
SELECT * FROM meta.operator;
-- List policies
SELECT * FROM meta.policy;
Available Views
cast, column, connection, constraint_check, constraint_unique, extension, foreign_column, foreign_data_wrapper, foreign_key, foreign_server, foreign_table, function, function_parameter, operator, policy, policy_role, relation, relation_column, role, role_inheritance, schema, sequence, table, table_privilege, trigger, type, view
Meta-Identifiers
The extension provides composite types that serve as “soft” primary keys to identify PostgreSQL objects by name (tables, columns, types, etc.) rather than by OID.
Catalog Triggers (Optional)
With the optional meta_triggers extension, views become updatable, enabling DDL via DML:
-- Create a table via INSERT
INSERT INTO meta.table (schema_name, name) VALUES ('public', 'foo');
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.