📘 The --version
option is only supported for postgresql logical replicas.
m
: General purpose container c
: Compute-optimized container r
: Memory-optimized container
aptible db:replicate --logical
should work in most cases. This section provides additional details details on how the CLI command works for debugging or if you’d like to know more about what the command does for you.
The CLI command uses the pglogical
extension to set up logical replication between the existing Database and the new replica Database. At a high level, these are the steps the CLI command takes to setup logical replication for you:
max_worker_processes
on the replica based on the number of PostgreSQL databases being replicated. pglogical
uses several worker processes per database so it can easily exhaust the default max_worker_processes
if replicating more than a couple of databases.pglogical
’s copy of the source database structure includes assigning the same owner to each table and granting the same permissions. The roles must exist on the replica in order for this to work.template
:
aptible
user as the owner.pglogical
extension on the source and replica database.pglogical
subscription between the source and replica database. This will copy the source database’s structure (e.g. schemas, tables, permissions, extensions, etc.).information_schema
, pglogical
, and pglogical_origin
schemas and schemas that begin with pg_
(system schemas).replicating
state and, therefore, have not finished syncing the initial data from the source Database.