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
|
manual updated pgrx by Vonng
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
|
Source
pig build pkg pgdd; # build rpm/debInstall
Make sure PGDG and PIGSTY repo available:
pig repo add pgsql -u # add both repo and update cacheInstall 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 14Create this extension with:
CREATE EXTENSION pgdd;Usage
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