Pg_get_userbyid
Query PostgreSQL Tablespace Info with pg_tablespace
Jul 3, 2026 / · 8 min read · postgresql database administration sql queries tablespaces pg_tablespace storage catalogs postgres dba pg_get_userbyid pg_tablespace_location ·Query PostgreSQL Tablespace Info with pg_tablespace What tablespaces exist in this cluster, who owns each one, and where do their files actually live on disk? pg_tablespace answers all three: it holds one row per tablespace with the owner OID, access control list, storage options, and — via pg_tablespace_location() — …
Read MoreList PostgreSQL Collations with pg_collation and ICU
Apr 19, 2026 / · 6 min read · postgresql administration collation pg_collation pg_database pg_get_userbyid ·List Collations Available in PostgreSQL pg_collation is the system catalog that holds every collation a database can use — the sort-and-compare rules behind ORDER BY, DISTINCT, comparison operators and text indexes. One query against it shows each collation's name, the library that implements it, and the locale it maps …
Read MoreList All Schemas in Your PostgreSQL Database
Apr 13, 2026 / · 8 min read · postgresql administration database information_schema pg_namespace pg_class pg_tables pg_get_userbyid ·How to List All Schemas in a PostgreSQL Database information_schema.schemata is the SQL-standard view for listing schemas, and it returns one row per schema in the current database that the connected role owns or holds a privilege on. Behind it sits pg_namespace, the system catalog that stores every schema with its …
Read MoreList PostgreSQL Partitioned Tables with SQL
Apr 9, 2026 / · 8 min read · partitioning administration pg_class pg_namespace pg_inherits pg_get_userbyid pg_partition_tree pg_relation_size pg_size_pretty ·List Partitioned and Ordinary Tables in PostgreSQL Before you change a retention job, plan a migration, or add a partition for next month, you need a plain list of which tables are partitioned and which are not. pg_class joined to pg_namespace gives that list for the whole database in one query, and a count from …
Read MoreGRANT SELECT on All Tables in PostgreSQL — with Examples
Mar 27, 2026 / · 12 min read · postgresql database administration sql queries security access control permissions etl postgres dba pg_default_acl pg_class pg_get_userbyid ·Grant SELECT on All Tables in PostgreSQL Third-party ETL connectors, BI platforms, and audit users all need read access to PostgreSQL tables — without write permissions that could corrupt production data. Granting SELECT table by table works until someone adds a new table and the connector silently skips it; ALTER …
Read MoreList PostgreSQL Databases by Size with Access Check
Apr 1, 2024 / · 3 min read · postgresql database optimization query pg_database pg_database_size pg_get_userbyid pg_size_pretty ·List Your PostgreSQL Databases by Size (With Access Check) Keeping your PostgreSQL database server organized is crucial for optimal performance and manageability. A critical aspect of this organization is understanding the storage footprint of each database. This SQL code snippet empowers you to efficiently retrieve a …
Read More