USER_CLUSTERS(5)
π USER_CLUSTERS(5) π
okay bestie, so this is a section 5 manual page β that's the "file formats and conventions" girlies β and it's part of the Debian PostgreSQL infrastructure. so you know it's giving real-deal system config energy. sit down, grab a strawberry, we're mapping users to clusters π
β¨ NAME β¨
user_clusters β the file that links users to PostgreSQL clusters π¦
πΈ DESCRIPTION πΈ
so like. the file /etc/postgresql-common/user_clusters maps users against the database clusters they'll connect to by default. that's its whole thing. that's its moment. iconic behavior honestly.
but β and this is important β every single user can override these settings in ~/.postgresqlrc. so the file is more of a vibe suggestion than a vibe mandate, iykyk. π
when scanning this file, the first matching line will be used. not the last, not the best, not the prettiest β the first. so it is a really good idea to provide a default explicitly, with a final line where both user and group are set to *. put it last. periodt.
and if there is no default? if you just. didn't bother? the implicit default is:
- connect to the cluster listening on port
5432 - connect to the database matching the user's login name
so like, it'll work, but it's giving "I forgot to do the assignment and I'm improvising." do the assignment. π
π FORMAT π
comments are introduced by the character #. comments may follow data on a line β the first comment character terminates the data. leading whitespace and blank lines are ignored, so go ahead and indent, she doesn't care, she's unbothered, she's thriving. π
each uncommented, non-blank line must describe a user, a group, or the default (where both user and group are set to *).
fields must be given in the following order, separated by white space:
USERβ the login id of the Unix user to whom this line applies. the wildcard character*means any user. βGROUPβ the group name of the Unix group to which this line applies. the wildcard character*means any group. βVERSIONβ the major PostgreSQL version of the cluster to connect to.CLUSTERβ the name of a cluster to connect to. a remote cluster is specified withhost:port. if port is empty, it defaults to5432.DATABASEβ within the cluster, the database to which the user will connect by default if he does not specify a database on the command line. if this is*, the default database will be the one named by the user's login id. π
π NOTES π
since the first matching line is used, the default line must come last. bestie. I'm serious. put the default. at the bottom. π₯
fr fr, this is the one thing everyone gets wrong and then they're in the group chat like "why is my cluster wrong" and it's because the default was on line 2. π
π¦ SEE ALSO π¦
and that's the page!! mwah π this one's from the Debian era, dated Feburary 2005 (yes, that's how it's spelled in the source, and yes, we're preserving it, no cap β every detail stays, that's the rule π«Ά). stay slay, go read postgresqlrc(5) next. bye bestie!! πβ¨
π¦ 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