Databases and warehouses
Find and export
your PostgreSQL data.
PostgreSQL can report database and table sizes directly through SQL. These are on-disk measurements, while a logical export contains live records and definitions and can be smaller.
- Report in
- GB
- Category
- Databases and warehouses
- Last checked
Find your PostgreSQL data size
- Connect with a SQL client using an account allowed to inspect the databases in scope.
- Run the read-only size query below and record the databases included.
- For important tables, use pg_total_relation_size for table-plus-index size and inspect row counts separately.
- Use the earliest relevant record timestamp to establish the retained business period.
SELECT datname, pg_database_size(datname) AS size_bytes
FROM pg_database
WHERE NOT datistemplate
ORDER BY size_bytes DESC;What to include in your data inventory
Report in GB, naming databases, schemas and the measurement basis. Add principal table and record counts where useful.
Describe the oldest retained business dates, external files and backups separately. Identify the application or staff scope represented.
Export your PostgreSQL history
- Have the database administrator plan a consistent export, using a suitable replica where appropriate.
- Use pg_dump for each database in a supported custom, directory or SQL format.
- Review pg_dumpall --globals-only when roles and other cluster-wide definitions are required.
- Collect external files separately and verify the archive against the agreed databases and schema.
pg_dump exports one database; cluster-wide roles and tablespaces use a separate route.
A dump contains live data and index definitions rather than the on-disk index contents and dead rows, so its size can differ from the meter.
Why PostgreSQL data has value for AI training
Application tables can preserve the events and relationships behind a business workflow.
Schema and field descriptions help connect those records to the operations they represent.
What stays private
Select databases, tables and columns in scope, reviewing personal fields and confidential application data.
Telegraph Lab reviews the proposed material with you and agrees how sensitive information will be handled. Preparation can include excluding material, redacting details and replacing personal identifiers. Your company keeps ownership; the licensing agreement defines the material, permitted uses and authorized recipients.
Common questions about PostgreSQL data
Why is the dump smaller than the database?
Storage includes physical structures that a logical dump represents differently, including indexes and unused space.
Does pg_dump collect every database?
It handles one database at a time. Review cluster-wide objects separately.
Are estimated row counts exact?
Statistics are estimates. COUNT(*) produces an exact count for the query's snapshot.
Are files stored outside PostgreSQL included?
Collect external storage separately and preserve its record links.