Skip to content
pgdd

pgdd

pgdd : Introspect pg data dictionary via standard SQL

Overview

ID Extension Package Version Category License Language
5130
pgdd
pgdd
0.6.1
ADMIN
MIT
Rust
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
--s-d--
No
Yes
No
Yes
no
no
Relationships
Schemas dd
See Also
pg_catcheck
pg_orphaned
pg_checksums

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT
PIGSTY
0.6.1
18
17
16
15
14
pgdd -
RPM
PIGSTY
0.6.1
18
17
16
15
14
pgdd_$v -
DEB
PIGSTY
0.6.1
18
17
16
15
14
postgresql-$v-pgdd -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
el8.aarch64
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
el9.x86_64
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
el9.aarch64
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
el10.x86_64
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
el10.aarch64
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
d12.x86_64
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
d12.aarch64
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
d13.x86_64
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
d13.aarch64
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
u22.x86_64
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
u22.aarch64
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
u24.x86_64
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
u24.aarch64
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
u26.x86_64
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
u26.aarch64
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
PIGSTY 0.6.1
Package Version OS ORG SIZE File URL
pgdd_18 0.6.1 el8.x86_64 pigsty 846.3 KiB pgdd_18-0.6.1-3PIGSTY.el8.x86_64.rpm
pgdd_18 0.6.1 el8.aarch64 pigsty 756.7 KiB pgdd_18-0.6.1-3PIGSTY.el8.aarch64.rpm
pgdd_18 0.6.1 el9.x86_64 pigsty 850.9 KiB pgdd_18-0.6.1-3PIGSTY.el9.x86_64.rpm
pgdd_18 0.6.1 el9.aarch64 pigsty 803.1 KiB pgdd_18-0.6.1-3PIGSTY.el9.aarch64.rpm
pgdd_18 0.6.1 el10.x86_64 pigsty 851.2 KiB pgdd_18-0.6.1-3PIGSTY.el10.x86_64.rpm
pgdd_18 0.6.1 el10.aarch64 pigsty 781.8 KiB pgdd_18-0.6.1-3PIGSTY.el10.aarch64.rpm
postgresql-18-pgdd 0.6.1 d12.x86_64 pigsty 673.0 KiB postgresql-18-pgdd_0.6.1-3PIGSTY~bookworm_amd64.deb
postgresql-18-pgdd 0.6.1 d12.aarch64 pigsty 561.8 KiB postgresql-18-pgdd_0.6.1-3PIGSTY~bookworm_arm64.deb
postgresql-18-pgdd 0.6.1 d13.x86_64 pigsty 672.1 KiB postgresql-18-pgdd_0.6.1-3PIGSTY~trixie_amd64.deb
postgresql-18-pgdd 0.6.1 d13.aarch64 pigsty 562.1 KiB postgresql-18-pgdd_0.6.1-3PIGSTY~trixie_arm64.deb
postgresql-18-pgdd 0.6.1 u22.x86_64 pigsty 746.2 KiB postgresql-18-pgdd_0.6.1-3PIGSTY~jammy_amd64.deb
postgresql-18-pgdd 0.6.1 u22.aarch64 pigsty 664.2 KiB postgresql-18-pgdd_0.6.1-3PIGSTY~jammy_arm64.deb
postgresql-18-pgdd 0.6.1 u24.x86_64 pigsty 739.9 KiB postgresql-18-pgdd_0.6.1-3PIGSTY~noble_amd64.deb
postgresql-18-pgdd 0.6.1 u24.aarch64 pigsty 654.5 KiB postgresql-18-pgdd_0.6.1-3PIGSTY~noble_arm64.deb
postgresql-18-pgdd 0.6.1 u26.x86_64 pigsty 736.3 KiB postgresql-18-pgdd_0.6.1-3PIGSTY~resolute_amd64.deb
postgresql-18-pgdd 0.6.1 u26.aarch64 pigsty 654.3 KiB postgresql-18-pgdd_0.6.1-3PIGSTY~resolute_arm64.deb

Source

pig build pkg pgdd;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

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

Install this extension with pig:

pig install pgdd;		# install via package name, for the active PG version

pig install pgdd -v 18;   # install for PG 18
pig install pgdd -v 17;   # install for PG 17
pig install pgdd -v 16;   # install for PG 16
pig install pgdd -v 15;   # install for PG 15
pig install pgdd -v 14;   # install for PG 14

Create this extension with:

CREATE EXTENSION pgdd;

Usage

pgdd: Introspect pg data dictionary via standard SQL

PgDD provides data dictionary views in the dd schema for introspecting database objects via standard SQL.

Database Overview

SELECT * FROM dd.database;

Returns: db_name, db_size, schema_count, table_count, size_in_tables, view_count, size_in_views, extension_count.

Schemas

SELECT s_name, table_count, view_count, function_count, size_plus_indexes, description
  FROM dd.schemas;

Tables

SELECT t_name, size_pretty, rows, bytes_per_row
  FROM dd.tables
  WHERE s_name = 'public';

Views

SELECT s_name, v_name, description FROM dd.views;

Columns

SELECT source_type, s_name, t_name, c_name, data_type
  FROM dd.columns
  WHERE data_type LIKE 'int%';

Functions

SELECT s_name, f_name, argument_data_types, result_data_types FROM dd.functions;

Partitioned Tables

SELECT * FROM dd.partition_parents WHERE s_name = 'public';
SELECT * FROM dd.partition_children WHERE s_name = 'public';

The partition_parents view shows aggregate partition stats (count, total size, total rows). The partition_children view shows per-partition details with percentage calculations against the parent.

System objects are excluded by default. To include them, query the underlying functions directly: SELECT * FROM dd.tables() WHERE system_object;

Last updated on