"repliation" as database name

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: "repliation" as database name
Date: 2018-12-18 09:48:25
Message-ID: 20181218.184825.02619975.horiguchi.kyotaro@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello.

We can create a database named "replication".

$ createdb replication

A pg_hba.conf entry with DATABASE="all" is described as 'does not
match "replication"' in the comment there, but actually it
matches and we can connect to the database
"replication". (Documentation doesn't mention the restriction)

$ psql replication -At -c 'select current_database()'
replication

We can specify the name replication by quoting and it does not
match a replication connection. It is not documented at all.

pg_hba.conf
> local "replication" all trust
> #local replication all trust ## commented out

> FATAL: could not connect to the primary server: FATAL: no pg_hba.conf entry for replication connection from host "[local]", user "horiguti", SSL off

> $ psql replication -At -c 'select current_database()'
> replication

The same can be said to sameuser, samerole and even all. I think
this is absolutely sane behavior and worth documentation in any
extent if it doesn't become complex.

I think that at least the following amendments would be needed.

- Remove ""all" does not match "replication"". Instead "The "all"
keyword does not match replication connections."

- double-quoted database name is taken literally.

Is it worth doing?

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Suraj Kharage 2018-12-18 09:57:11 Re: Catalog views failed to show partitioned table information.
Previous Message Konstantin Knizhnik 2018-12-18 09:41:37 Re: Built-in connection pooling