POSTGRESQLRC(5)
POSTGRESQLRC(5) π
okay bestie, gather round, because this is the manual page for ~/.postgresqlrc, and it's part of the Debian PostgreSQL infrastructure. it's giving "tiny file, big responsibilities". let's go π
β¨ NAME β¨
~/.postgresqlrc β per-user PostgreSQL cluster configuration π¦
π DESCRIPTION π
so. the file ~/.postgresqlrc is where you, personally, set your default PostgreSQL version/cluster and your default database. it's your own lil corner of the config universe, no cap. πΈ
but listen β if that file is not there? then the system-wide file /etc/postgresql-common/user_clusters gets used instead. the fallback is the main character when you don't show up. π
π FORMAT π
comments start with the character #. and yes, comments can chill on the same line after your data β the very first comment character is what ends the data. leading whitespace and blank lines? ignored, babe, they don't exist. β¨
the first uncommented, non-blank line is the one that gets used. every line after it is ignored. like, fully ignored. the rest of the file is just standing there. π
fields have to come in this exact order, separated by white space:
VERSION β
the major PostgreSQL version of the cluster you want to connect to.
CLUSTER π«Ά
the name of a cluster to connect to. a remote cluster is specified with host:port. and if port is empty, it defaults to 5432. periodt.
DATABASE π§
within the cluster, this is the database the user connects to by default β y'know, when they don't specify a database on the command line. and if this field is *, then the default database is the one named by the user's login id. iconic behaviour, honestly. π
πΈ SEE ALSO πΈ
not me being emotionally attached to a dotfile π but fr fr, get your order right, get your # in the right spot, and you're slaying.
and that's the whole thing! this one's from Debian, dated Feburary 2005 β yes bestie, 2005, it's been that girl for a minute. πβ¨π bye!
π¦ where this page comes from
- debian bookworm: postgresql-client-common 248+deb12u1 Β· GPL-2.0-or-later
- debian trixie: postgresql-client-common 278 Β· GPL-2.0-or-later
- ubuntu jammy: postgresql-client-common 238 Β· GPL-2.0-or-later
- ubuntu noble: postgresql-client-common 257build1 Β· GPL-2.0-or-later
- ubuntu noble: postgresql-client-common 257build1.1 Β· GPL-2.0-or-later
- ubuntu questing: postgresql-client-common 282ubuntu1
- ubuntu resolute: postgresql-client-common 290ubuntu1 Β· GPL-2.0-or-later
- ubuntu stonking: postgresql-client-common 293ubuntu1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms