pgd node set-config
===================

Synopsis
--------

The ``pgd node set-config`` command is used to set node-level Postgres
setting (GUC) in the EDB Postgres Distributed cluster. The command
requires node ``DSN`` for ``superuser`` i.e. Postgres process owner
user.

The command reloads the configuration on the node after setting the
config and displays a warning of the GUC requires a server restart.

Users and roles
^^^^^^^^^^^^^^^

Requires Postgres superuser privileges to run ``ALTER SYSTEM`` and
reload the configuration. See :ref:`User roles <User roles>`  .

Syntax
------

.. code:: plaintext

   pgd node <NODE_NAME> set-config [OPTIONS] <CONFIG> <VALUE>

Where ``<NODE_NAME>`` is the name of the node for which you want to get
options.

And ``<CONFIG>`` is the name of a specific node config you want to get
and ``<VALUE>`` is the value you want it set to.

Options
-------

No command specific options. See `Global Options <https://www.enterprisedb.com/docs/pgd/latest/reference/cli/command_ref/#global-options>`_  .

Examples
--------

Set a specific node config
^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code:: shell

   pgd node pgd-a1 set-config bdr.batch_inserts 20 --dsn "host=pgd-a1 port=5432 user=postgres "
   __OUTPUT__
   Command executed successfully

Set a specific node config with a space in the value
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code:: shell

   pgd node pgd-a2 set-config unix_socket_directories "/var/run/edb-pge, /tmp, /var/lib/postgresql" --dsn "host=pgd-a2 port=5432 user=postgres "
   __OUTPUT__
   WARN: Config change requires a Postgres restart to take effect.
   Command executed successfully

Please note the ``WARN`` message indicates that the configuration change
will not take effect until the Postgres server is restarted.
