PostgreSQL Extension: More friendly system catalog for PostgreSQL
System catalogs are great, because they provide a data-centric view into the database’s structure.
PostgreSQL has two system catalogs, pg_catalog
and information_schema
, but each have some
drawbacks. pg_catalog
mirrors PostgreSQL’s internal structure, and centers around oid
, object
identifiers that aren’t intended for “above the hood” developers to know or care about.information_schema
is part of the SQL standard, and is filled with many views and columns that
don’t match PostgreSQL’s terminology or features.
The goals with meta
is to provide an “above the hood” system catalog for PostgreSQL that is
normalized and uses common names for views and columns.
Features:
pg_catalog
and information_schema
CREATE TABLE ...
) with an DML statement (e.g. insert into
meta.table (name) values('foo'))
, similar to a schema diff and migration tool but with aStatus:
Install the extension into PostgreSQL’s extension/
directory:
cd meta/
make
sudo make install
From a PostgreSQL shell, install the hstore
extension in schema public
.
CREATE EXTENSION hstore SCHEMA public;
Finally, install the meta extension:
CREATE EXTENSION meta;
Optionally, install the meta_triggers extension, to make views updatable.
See identifiers.
The system catalog contains the following views: