---
name: "pg_renamecluster"
section: "1"
platform: "linux"
package: "postgresql-common"
version: "278"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/pg_renamecluster"
---

# pg\_renamecluster(1)

rename a PostgreSQL cluster

## NAME

pg\_renamecluster - rename a PostgreSQL cluster

## SYNOPSIS

**pg\_renamecluster** *version* *oldname* *newname*

## DESCRIPTION

**pg\_renamecluster** changes the name of a PostgreSQL cluster, i. e. the name of the config directory in /etc/postgresql/*version*/ along with the data directory in /var/lib/postgresql/*version*/.  Existing log files in /var/log/postgresql/ are also renamed.  The cluster is stopped and started for the operation.

The following **postgresql.conf** config options are updated to refer to the changed path names: **data\_directory**, **hba\_file**, **ident\_file**, **external\_pid\_file**, **stats\_temp\_directory**, **cluster\_name**.

## OPTIONS

None.

## SEE ALSO

[**pg\_createcluster**(8)](/pg_createcluster/8.md), [**pg\_dropcluster**(8)](/pg_dropcluster/8.md), [**pg\_lsclusters**(1)](/pg_lsclusters/1.md), [**pg\_wrapper**(1)](/pg_wrapper/1.md)

## AUTHOR

Christoph Berg \<myon@debian.org\>
