跳转到主要内容

meta

标准化,更友好的PostgreSQL系统目录视图

pg_meta · 标准化,更友好的PostgreSQL系统目录视图

概览

ID扩展软件包版本类别许可证编程语言
6440metapg_meta0.4.0STATBSD-2-ClauseSQL
属性可执行文件动态库需要预加载需要建扩展可迁移可信
----d--否否否是否否

软件包

类型仓库版本兼容的 PostgreSQL 大版本包名模式依赖
EXTPIGSTY0.4.019 18 17 16 15pg_meta-
RPMPIGSTY0.4.019 18 17 16 15pg_meta_$v-
DEBPIGSTY0.4.019 18 17 16 15postgresql-$v-pg-meta-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0
el8.aarch64N/APIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0
el9.x86_64PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0
el9.aarch64PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0
el10.x86_64PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0
el10.aarch64PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0
d12.x86_64PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0
d12.aarch64PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0
d13.x86_64PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0
d13.aarch64PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0
u22.x86_64PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0
u22.aarch64PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0
u24.x86_64PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0
u24.aarch64PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0
u26.x86_64PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0
u26.aarch64PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0PIGSTY 0.4.0
软件包版本平台仓库大小下载
pg_meta_190.4.0el9.x86_64pigsty15.7 KiBpg_meta_19-0.4.0-1PGSTY.el9.noarch.rpm
pg_meta_190.4.0el9.aarch64pigsty15.7 KiBpg_meta_19-0.4.0-1PGSTY.el9.noarch.rpm
pg_meta_190.4.0el10.x86_64pigsty15.9 KiBpg_meta_19-0.4.0-1PGSTY.el10.noarch.rpm
pg_meta_190.4.0el10.aarch64pigsty15.9 KiBpg_meta_19-0.4.0-1PGSTY.el10.noarch.rpm
postgresql-19-pg-meta0.4.0d12.x86_64pigsty11.4 KiBpostgresql-19-pg-meta_0.4.0-1PGSTY~bookworm_all.deb
postgresql-19-pg-meta0.4.0d12.aarch64pigsty11.4 KiBpostgresql-19-pg-meta_0.4.0-1PGSTY~bookworm_all.deb
postgresql-19-pg-meta0.4.0d13.x86_64pigsty11.4 KiBpostgresql-19-pg-meta_0.4.0-1PGSTY~trixie_all.deb
postgresql-19-pg-meta0.4.0d13.aarch64pigsty11.4 KiBpostgresql-19-pg-meta_0.4.0-1PGSTY~trixie_all.deb
postgresql-19-pg-meta0.4.0u22.x86_64pigsty11.4 KiBpostgresql-19-pg-meta_0.4.0-1PGSTY~jammy_all.deb
postgresql-19-pg-meta0.4.0u22.aarch64pigsty11.4 KiBpostgresql-19-pg-meta_0.4.0-1PGSTY~jammy_all.deb
postgresql-19-pg-meta0.4.0u24.x86_64pigsty11.5 KiBpostgresql-19-pg-meta_0.4.0-1PGSTY~noble_all.deb
postgresql-19-pg-meta0.4.0u24.aarch64pigsty11.5 KiBpostgresql-19-pg-meta_0.4.0-1PGSTY~noble_all.deb
postgresql-19-pg-meta0.4.0u26.x86_64pigsty11.5 KiBpostgresql-19-pg-meta_0.4.0-1PGSTY~resolute_all.deb
postgresql-19-pg-meta0.4.0u26.aarch64pigsty11.5 KiBpostgresql-19-pg-meta_0.4.0-1PGSTY~resolute_all.deb
软件包版本平台仓库大小下载
pg_meta_180.4.0el8.x86_64pigsty16.3 KiBpg_meta_18-0.4.0-1PGSTY.el8.noarch.rpm
pg_meta_180.4.0el8.aarch64pigsty16.3 KiBpg_meta_18-0.4.0-1PGSTY.el8.noarch.rpm
pg_meta_180.4.0el9.x86_64pigsty15.7 KiBpg_meta_18-0.4.0-1PGSTY.el9.noarch.rpm
pg_meta_180.4.0el9.aarch64pigsty15.7 KiBpg_meta_18-0.4.0-1PGSTY.el9.noarch.rpm
pg_meta_180.4.0el10.x86_64pigsty15.9 KiBpg_meta_18-0.4.0-1PGSTY.el10.noarch.rpm
pg_meta_180.4.0el10.aarch64pigsty15.9 KiBpg_meta_18-0.4.0-1PGSTY.el10.noarch.rpm
postgresql-18-pg-meta0.4.0d12.x86_64pigsty11.4 KiBpostgresql-18-pg-meta_0.4.0-1PGSTY~bookworm_all.deb
postgresql-18-pg-meta0.4.0d12.aarch64pigsty11.4 KiBpostgresql-18-pg-meta_0.4.0-1PGSTY~bookworm_all.deb
postgresql-18-pg-meta0.4.0d13.x86_64pigsty11.4 KiBpostgresql-18-pg-meta_0.4.0-1PGSTY~trixie_all.deb
postgresql-18-pg-meta0.4.0d13.aarch64pigsty11.4 KiBpostgresql-18-pg-meta_0.4.0-1PGSTY~trixie_all.deb
postgresql-18-pg-meta0.4.0u22.x86_64pigsty11.4 KiBpostgresql-18-pg-meta_0.4.0-1PGSTY~jammy_all.deb
postgresql-18-pg-meta0.4.0u22.aarch64pigsty11.4 KiBpostgresql-18-pg-meta_0.4.0-1PGSTY~jammy_all.deb
postgresql-18-pg-meta0.4.0u24.x86_64pigsty11.5 KiBpostgresql-18-pg-meta_0.4.0-1PGSTY~noble_all.deb
postgresql-18-pg-meta0.4.0u24.aarch64pigsty11.5 KiBpostgresql-18-pg-meta_0.4.0-1PGSTY~noble_all.deb
postgresql-18-pg-meta0.4.0u26.x86_64pigsty11.5 KiBpostgresql-18-pg-meta_0.4.0-1PGSTY~resolute_all.deb
postgresql-18-pg-meta0.4.0u26.aarch64pigsty11.5 KiBpostgresql-18-pg-meta_0.4.0-1PGSTY~resolute_all.deb
软件包版本平台仓库大小下载
pg_meta_170.4.0el8.x86_64pigsty16.3 KiBpg_meta_17-0.4.0-1PGSTY.el8.noarch.rpm
pg_meta_170.4.0el8.aarch64pigsty16.3 KiBpg_meta_17-0.4.0-1PGSTY.el8.noarch.rpm
pg_meta_170.4.0el9.x86_64pigsty15.7 KiBpg_meta_17-0.4.0-1PGSTY.el9.noarch.rpm
pg_meta_170.4.0el9.aarch64pigsty15.7 KiBpg_meta_17-0.4.0-1PGSTY.el9.noarch.rpm
pg_meta_170.4.0el10.x86_64pigsty15.9 KiBpg_meta_17-0.4.0-1PGSTY.el10.noarch.rpm
pg_meta_170.4.0el10.aarch64pigsty15.9 KiBpg_meta_17-0.4.0-1PGSTY.el10.noarch.rpm
postgresql-17-pg-meta0.4.0d12.x86_64pigsty11.4 KiBpostgresql-17-pg-meta_0.4.0-1PGSTY~bookworm_all.deb
postgresql-17-pg-meta0.4.0d12.aarch64pigsty11.4 KiBpostgresql-17-pg-meta_0.4.0-1PGSTY~bookworm_all.deb
postgresql-17-pg-meta0.4.0d13.x86_64pigsty11.4 KiBpostgresql-17-pg-meta_0.4.0-1PGSTY~trixie_all.deb
postgresql-17-pg-meta0.4.0d13.aarch64pigsty11.4 KiBpostgresql-17-pg-meta_0.4.0-1PGSTY~trixie_all.deb
postgresql-17-pg-meta0.4.0u22.x86_64pigsty11.4 KiBpostgresql-17-pg-meta_0.4.0-1PGSTY~jammy_all.deb
postgresql-17-pg-meta0.4.0u22.aarch64pigsty11.4 KiBpostgresql-17-pg-meta_0.4.0-1PGSTY~jammy_all.deb
postgresql-17-pg-meta0.4.0u24.x86_64pigsty11.5 KiBpostgresql-17-pg-meta_0.4.0-1PGSTY~noble_all.deb
postgresql-17-pg-meta0.4.0u24.aarch64pigsty11.5 KiBpostgresql-17-pg-meta_0.4.0-1PGSTY~noble_all.deb
postgresql-17-pg-meta0.4.0u26.x86_64pigsty11.4 KiBpostgresql-17-pg-meta_0.4.0-1PGSTY~resolute_all.deb
postgresql-17-pg-meta0.4.0u26.aarch64pigsty11.4 KiBpostgresql-17-pg-meta_0.4.0-1PGSTY~resolute_all.deb
软件包版本平台仓库大小下载
pg_meta_160.4.0el8.x86_64pigsty16.3 KiBpg_meta_16-0.4.0-1PGSTY.el8.noarch.rpm
pg_meta_160.4.0el8.aarch64pigsty16.3 KiBpg_meta_16-0.4.0-1PGSTY.el8.noarch.rpm
pg_meta_160.4.0el9.x86_64pigsty15.7 KiBpg_meta_16-0.4.0-1PGSTY.el9.noarch.rpm
pg_meta_160.4.0el9.aarch64pigsty15.7 KiBpg_meta_16-0.4.0-1PGSTY.el9.noarch.rpm
pg_meta_160.4.0el10.x86_64pigsty15.9 KiBpg_meta_16-0.4.0-1PGSTY.el10.noarch.rpm
pg_meta_160.4.0el10.aarch64pigsty15.9 KiBpg_meta_16-0.4.0-1PGSTY.el10.noarch.rpm
postgresql-16-pg-meta0.4.0d12.x86_64pigsty11.4 KiBpostgresql-16-pg-meta_0.4.0-1PGSTY~bookworm_all.deb
postgresql-16-pg-meta0.4.0d12.aarch64pigsty11.4 KiBpostgresql-16-pg-meta_0.4.0-1PGSTY~bookworm_all.deb
postgresql-16-pg-meta0.4.0d13.x86_64pigsty11.4 KiBpostgresql-16-pg-meta_0.4.0-1PGSTY~trixie_all.deb
postgresql-16-pg-meta0.4.0d13.aarch64pigsty11.4 KiBpostgresql-16-pg-meta_0.4.0-1PGSTY~trixie_all.deb
postgresql-16-pg-meta0.4.0u22.x86_64pigsty11.4 KiBpostgresql-16-pg-meta_0.4.0-1PGSTY~jammy_all.deb
postgresql-16-pg-meta0.4.0u22.aarch64pigsty11.4 KiBpostgresql-16-pg-meta_0.4.0-1PGSTY~jammy_all.deb
postgresql-16-pg-meta0.4.0u24.x86_64pigsty11.5 KiBpostgresql-16-pg-meta_0.4.0-1PGSTY~noble_all.deb
postgresql-16-pg-meta0.4.0u24.aarch64pigsty11.5 KiBpostgresql-16-pg-meta_0.4.0-1PGSTY~noble_all.deb
postgresql-16-pg-meta0.4.0u26.x86_64pigsty11.5 KiBpostgresql-16-pg-meta_0.4.0-1PGSTY~resolute_all.deb
postgresql-16-pg-meta0.4.0u26.aarch64pigsty11.5 KiBpostgresql-16-pg-meta_0.4.0-1PGSTY~resolute_all.deb
软件包版本平台仓库大小下载
pg_meta_150.4.0el8.x86_64pigsty16.3 KiBpg_meta_15-0.4.0-1PGSTY.el8.noarch.rpm
pg_meta_150.4.0el8.aarch64pigsty16.3 KiBpg_meta_15-0.4.0-1PGSTY.el8.noarch.rpm
pg_meta_150.4.0el9.x86_64pigsty15.7 KiBpg_meta_15-0.4.0-1PGSTY.el9.noarch.rpm
pg_meta_150.4.0el9.aarch64pigsty15.7 KiBpg_meta_15-0.4.0-1PGSTY.el9.noarch.rpm
pg_meta_150.4.0el10.x86_64pigsty15.9 KiBpg_meta_15-0.4.0-1PGSTY.el10.noarch.rpm
pg_meta_150.4.0el10.aarch64pigsty15.9 KiBpg_meta_15-0.4.0-1PGSTY.el10.noarch.rpm
postgresql-15-pg-meta0.4.0d12.x86_64pigsty11.4 KiBpostgresql-15-pg-meta_0.4.0-1PGSTY~bookworm_all.deb
postgresql-15-pg-meta0.4.0d12.aarch64pigsty11.4 KiBpostgresql-15-pg-meta_0.4.0-1PGSTY~bookworm_all.deb
postgresql-15-pg-meta0.4.0d13.x86_64pigsty11.4 KiBpostgresql-15-pg-meta_0.4.0-1PGSTY~trixie_all.deb
postgresql-15-pg-meta0.4.0d13.aarch64pigsty11.4 KiBpostgresql-15-pg-meta_0.4.0-1PGSTY~trixie_all.deb
postgresql-15-pg-meta0.4.0u22.x86_64pigsty11.4 KiBpostgresql-15-pg-meta_0.4.0-1PGSTY~jammy_all.deb
postgresql-15-pg-meta0.4.0u22.aarch64pigsty11.4 KiBpostgresql-15-pg-meta_0.4.0-1PGSTY~jammy_all.deb
postgresql-15-pg-meta0.4.0u24.x86_64pigsty11.5 KiBpostgresql-15-pg-meta_0.4.0-1PGSTY~noble_all.deb
postgresql-15-pg-meta0.4.0u24.aarch64pigsty11.5 KiBpostgresql-15-pg-meta_0.4.0-1PGSTY~noble_all.deb
postgresql-15-pg-meta0.4.0u26.x86_64pigsty11.5 KiBpostgresql-15-pg-meta_0.4.0-1PGSTY~resolute_all.deb
postgresql-15-pg-meta0.4.0u26.aarch64pigsty11.5 KiBpostgresql-15-pg-meta_0.4.0-1PGSTY~resolute_all.deb

源码

pig build pkg pg_meta;		# build rpm/deb

安装

启用 PGDG 和 PIGSTY 仓库并更新缓存。

pig repo add pgsql -u   # add both repo and update cache

使用 pig 安装扩展。

pig install pg_meta;		# install by package name
pig install meta;		# install by extension name

pig install meta -v 19;   # install for PG 19
pig install meta -v 18;   # install for PG 18
pig install meta -v 17;   # install for PG 17
pig install meta -v 16;   # install for PG 16
pig install meta -v 15;   # install for PG 15

在数据库中创建扩展。

CREATE EXTENSION meta;

用法

meta: PostgreSQL 简化系统目录

meta 提供一套规范化、易于理解的系统目录视图,使用通用的视图名和列名,构建于 pg_catalog 和 information_schema 之上。

系统目录视图

该扩展在 meta 模式下创建约 30 个视图:

-- 列出所有表
SELECT * FROM meta.table;

-- 列出所有列
SELECT * FROM meta.column;

-- 列出所有视图
SELECT * FROM meta.view;

-- 列出模式
SELECT * FROM meta.schema;

-- 列出函数
SELECT * FROM meta.function;

-- 列出扩展
SELECT * FROM meta.extension;

-- 列出触发器
SELECT * FROM meta.trigger;

-- 列出外键
SELECT * FROM meta.foreign_key;

-- 列出约束
SELECT * FROM meta.constraint_check;
SELECT * FROM meta.constraint_unique;

-- 列出类型
SELECT * FROM meta.type;

-- 列出角色
SELECT * FROM meta.role;

-- 列出序列
SELECT * FROM meta.sequence;

-- 列出运算符
SELECT * FROM meta.operator;

-- 列出策略
SELECT * FROM meta.policy;

可用视图

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

元标识符

该扩展提供复合类型作为"软"主键,通过名称(而非 OID)来标识 PostgreSQL 对象(表、列、类型等)。

目录触发器(可选)

通过可选的 meta_triggers 扩展,视图变为可更新,从而支持通过 DML 执行 DDL:

-- 通过 INSERT 创建表
INSERT INTO meta.table (schema_name, name) VALUES ('public', 'foo');

表格阅读器