Command reference v6.5.0

The command name for the PGD command line interface is pgd.

Synopsis

The EDB Postgres Distributed Command Line Interface (PGD CLI) is a tool to manage your EDB Postgres Distributed cluster. It allows you to run commands against EDB Postgres Distributed clusters. You can use it to inspect and manage cluster resources.

Commands

  • cluster: Cluster-level commands for managing the cluster.
    • show: Show cluster-level information.
    • verify: Verify cluster-level information.
  • group: Group-level commands for managing groups.
    • show: Show group-level information.
    • set-option: Set group-level options.
    • get-option: Get group-level options.
    • set-leader: Set the write leader of a group (perform a switchover).
  • groups: Group related commands for listing groups.
  • node: Node-level commands for managing nodes.
    • setup: Setup a node in the cluster.
    • show: Show node-level information.
    • part: Part a PGD node from an active cluster.
    • set-option: Set node-level options.
    • get-option: Get node-level options.
    • set-config: Set node-level configuration.
    • get-config: Get node-level configuration.
    • upgrade: Perform a major version upgrade of a PGD Postgres node.
    • start: Start the Postgres instance on a node.
    • stop: Stop the Postgres instance on a node.
    • restart: Restart the Postgres instance on a node.
  • nodes: Node related commands for listing nodes.
  • events: Event log commands for viewing events.
  • replication: Replication related-commands for managing replication.
    • show: Show replication information.
  • raft: Raft related commands for managing Raft consensus.
    • show: Show information about Raft state.
    • enable: Enable the Raft consensus worker on one or more nodes.
    • disable: Disable the Raft consensus worker on one or more nodes.
    • set-leader: Transfer Raft leadership to a specified node.
    • restore: Restore Raft consensus by removing the minimum set of nodes needed.
    • sync-snapshot: Synchronize Raft state across all nodes.
  • commit-scope: Commit scope related commands for managing PGD commit scopes.
    • show: Show information about a commit-scope.
    • create: Create a commit-scope.
    • update: Update a commit-scope.
    • drop: Drop a commit-scope.
    • list: List commit scopes.
  • assess: Assesses a Postgres server's PGD compatibility.
  • completion: Generate shell completion scripts.

User roles

Each pgd command connects as a specific Postgres role, or, for a few node-management commands, requires only OS-level access. Every command page includes a section stating the role it needs.

These roles are created automatically when the BDR extension is installed, so you don't need to create them yourself, only grant them to the user connecting with the CLI. See PGD predefined roles for the full privilege list behind each one.

RoleDescription
bdr_superuserFull PGD management. Granted ALL privileges directly on every table and function in the bdr schema, plus pg_read_all_stats. This is a superset of what every other role grants, even though it isn't formal role inheritance.
bdr_monitorRead-only cluster monitoring. Inherits bdr_read_all_stats and pg_read_all_stats (not pg_read_all_settings). Many show/list commands still require bdr_superuser, since they use internal functions that aren't granted to bdr_monitor.
bdr_read_all_statsReads PGD statistics and catalog views. Inherits pg_read_all_stats.
bdr_applicationApplication-level access, such as reading commit scopes. A separate role, not part of the monitoring chain.
Postgres superuserRequired for ALTER SYSTEM, CREATE EXTENSION, and pg_upgrade. Separate from bdr_superuser.
OS user (pg_ctl)Required by pgd node start/stop/restart, which are OS-level operations. No database role is checked.

Global Options

All commands accept the following global options:

ShortLong            Description
-f--config-fileName/Path to config file.
This is ignored if --dsn flag is present
Default "/etc/edb/pgd-cli/pgd-cli-config.yml"
--dsnDatabase connection string
For example "host=bdr-a1 port=5432 dbname=pgddb user=postgres"
Also set by PGD_CLI_DSN environment variable.
-h--helpHelp for pgd - will show specific help for any command used
-o--outputOutput format: json, psql, modern, markdown, simple (see Output formats)

Additional Options

Run pgd -V to see the version information for the pgd CLI.

Output formats

Used with the -o/--output option:

FormatDescription
simpleSimple format - Output as a simple ASCII table (Default).
jsonJSON format - Output as a JSON document, non-tabular
psqlPSQL format - Output as an ASCII table in the style of PSQL
modernModern format - Output as a table using box characters
markdownMarkdown table format - Output as a markdown compatible ASCII table