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!