Re: Why psql connection assumes default database name as the username - Mailing list pgsql-novice

From Neha Khatri
Subject Re: Why psql connection assumes default database name as the username
Date
Msg-id CAFO0U+_wMRkdFYUmwNBNe-=+u_bq4W6czttmQuaV=eF8kLzswg@mail.gmail.com
Whole thread Raw
In response to Re: [NOVICE] Why psql connection assumes default database name asthe username  (hubert depesz lubaczewski <depesz@depesz.com>)
Responses Re: Why psql connection assumes default database name asthe username  (hubert depesz lubaczewski <depesz@depesz.com>)
List pgsql-novice
On Fri, Mar 24, 2017 at 7:57 PM, hubert depesz lubaczewski <depesz@depesz.com> wrote:
On Fri, Mar 24, 2017 at 08:39:30AM +0000, Neha Khatri wrote:
> Yes, so psql should say "Not sure which database to connect to. Please
> specify a valid database name using -d option".
> For backwards compatibility, psql can still attempt to connect to db with
> name same as the username, but the error message could be more like
> providing the information, what can be done next.

Sorry, but I don't agree.
I use databases named like users all the time, and love the fact that
I don't have to provide dbname when it's obvious.

So, is it common practice to have a database name same as the username. What are the usecase advantages of the database name and username mapping? It would be good to understand.

Regards,
Neha

pgsql-novice by date:

Previous
From: Andrew Zakharov
Date:
Subject: [NOVICE] Undo all changes made by production release
Next
From: hubert depesz lubaczewski
Date:
Subject: Re: Why psql connection assumes default database name asthe username