The pgcopydb list command provides a JSON representation of the current state of a migration setup. This includes the configuration used for the snapshot and detailed metadata about the objects being migrated.
Setup Metadata
The setup object contains the configuration parameters used for the current snapshot, such as:
snapshot: The unique identifier for the snapshot.source_pguri: The connection URI for the source database.target_pguri: The connection URI for the target database.table-jobs: Number of concurrent jobs for table data migration.index-jobs: Number of concurrent jobs for index creation.split-tables-larger-than: Threshold for splitting large tables into parts.
Tables Metadata
The tables array contains an object for every table in the migration. Key fields include:
oid: The PostgreSQL Object ID.schema and name: The table's location.reltuples: Estimated number of rows.bytes and bytes-pretty: Size of the table.exclude-data: Boolean indicating if data is being skipped.restore-list-name: The identifier used to reference this table during restoration.part-key: The column used to split the table into parts (if applicable).parts: An array of objects describing how the table was split (e.g., number, total, min, max, count).
Indexes Metadata
The indexes array contains details about indexes to be recreated on the target, including:
isPrimary and isUnique: Boolean flags for index properties.sql: The exact SQL command used to create the index.table: An object identifying the parent table via oid, schema, and name.
{
"setup": {
"snapshot": "00000003-00051AAE-1",
"source_pguri": "postgres://@:/pagila?",
"target_pguri": "postgres://@:/plop?",
"table-jobs": 4,
"index-jobs": 4,
"split-tables-larger-than": 204800
},
"tables": [
{
"oid": 317934,
"schema": "public",
"name": "rental",
"reltuples": 16044,
"bytes": 1253376,
"bytes-pretty": "1224 kB",
"exclude-data": false,
"restore-list-name": "public rental postgres",
"part-key": "rental_id",
"parts": [
{
"number": 1,
"total": 7,
"min": 1,
"max": 2294,
"count": 2294
}
]
}
],
"indexes": [
{
"oid": 378283,
"schema": "pgcopydb",
"name": "sentinel_expr_idx",
"isPrimary": false,
"isUnique": true,
"columns": "",
"sql": "CREATE UNIQUE INDEX sentinel_expr_idx ON pgcopydb.sentinel USING btree ((1))",
"restore-list-name": "pgcopydb sentinel_expr_idx dim",
"table": {
"oid": 378280,
"schema": "pgcopydb",
"name": "sentinel"
}
}
]
}