"repliation" as database name - Mailing list pgsql-hackers

From Kyotaro HORIGUCHI
Subject "repliation" as database name
Date
Msg-id 20181218.184825.02619975.horiguchi.kyotaro@lab.ntt.co.jp
Whole thread Raw
Responses Re: "repliation" as database name  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
List 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



pgsql-hackers by date:

Previous
From: Konstantin Knizhnik
Date:
Subject: Re: Built-in connection pooling
Next
From: Suraj Kharage
Date:
Subject: Re: Catalog views failed to show partitioned table information.