pgd node upgrade v5
Synopsis
The pgd node upgrade
command is used to upgrade the PostgreSQL version on a node in the EDB Postgres Distributed cluster.
Syntax
pgd node <NODENAME> upgrade [OPTIONS] --old-bindir <OLD_BINDIR> --new-bindir <NEW_BINDIR> --old-datadir <OLD_DATADIR> --new-datadir <NEW_DATADIR> --database <DATABASE> --username <USERNAME>
Where <GROUPNAME>
is the name of the node which you want to upgrade and <OLD_BINDIR>
, <NEW_BINDIR>
, <OLD_DATADIR>
, <NEW_DATADIR>
, <DATABASE>
, and <USERNAME>
are the old and new Postgres instance bin directories, old and new Postgres instance data directories, database name, and cluster's install user name respectively.
Options
The following table lists the options available for the pgd group set-leader
command:
Short | Long | Default | Env | Description |
---|---|---|---|---|
-b | --old-bindir | PGBINOLD | Old Postgres instance bin directory | |
-B | --new-bindir | PGBINNEW | New Postgres instance bin directory | |
-d | --old-datadir | PGDATAOLD | Old Postgres instance data directory | |
-D | --new-datadir | PGDATANEW | New Postgres instance data directory | |
--database | PGDATABASE | PGD database name | ||
-p | --old-port | 5432 | PGPORTOLD | Old Postgres instance port |
--socketdir | /var/run/postgresql | PGSOCKETDIR | Directory to use for postmaster sockets during upgrade | |
--check | Specify to only perform checks and not modify clusters | |||
-j | --jobs | 1 | Number of simultaneous processes or threads to use | |
-k | --link | Use hard links instead of copying files to the new cluster | ||
--old-options | Option to pass to old postgres command, multiple invocations are appended | |||
--new-options | Option to pass to new postgres command, multiple invocations are appended | |||
-N | --no-sync | Don't wait for all files in the upgraded cluster to be written to disk | ||
-P | --new-port | 5432 | PGPORTNEW | New Postgres instance port number |
-r | --retain | Retain SQL and log files even after successful completion | ||
-U | --username | PGUSER | Cluster's install user name | |
--clone | Use efficient file cloning |
See also Global Options.
Examples
Upgrade the PostgreSQL version on a node
pgd node node-one upgrade --old-bindir /usr/pgsql-16/bin --new-bindir /usr/pgsql-17/bin --old-datadir /var/lib/pgsql/16/data --new-datadir /var/lib/pgsql/17/data --database bdrdb --username enterprisedb
Upgrade the PostgreSQL version on a node with hard links
pgd node node-one upgrade --old-bindir /usr/pgsql-16/bin --new-bindir /usr/pgsql-17/bin --old-datadir /var/lib/pgsql/16/data --new-datadir /var/lib/pgsql/17/data --database bdrdb --username enterprisedb --link
Upgrade the PostgreSQL version on a node with efficient file cloning
pgd node node-one upgrade --old-bindir /usr/pgsql-16/bin --new-bindir /usr/pgsql-17/bin --old-datadir /var/lib/pgsql/16/data --new-datadir /var/lib/pgsql/17/data --database bdrdb --username enterprisedb --clone
Upgrade the PostgreSQL version on a node with a different port number
pgd node node-one upgrade --old-bindir /usr/pgsql-16/bin --new-bindir /usr/pgsql-17/bin --old-datadir /var/lib/pgsql/16/data --new-datadir /var/lib/pgsql/17/data --database bdrdb --username enterprisedb --old-port 5433 --new-port 5434