Re: [NOVICE] Why psql connection assumes default database name asthe username - Mailing list pgsql-novice

From hubert depesz lubaczewski
Subject Re: [NOVICE] Why psql connection assumes default database name asthe username
Date
Msg-id 20170324062525.GA21483@depesz.com
Whole thread Raw
In response to Re: [NOVICE] Why psql connection assumes default database name as the username  (Neha Khatri <nehakhatri5@gmail.com>)
Responses Re: [NOVICE] Why psql connection assumes default database name as the username  (Neha Khatri <nehakhatri5@gmail.com>)
List pgsql-novice
On Fri, Mar 24, 2017 at 08:49:11AM +1100, Neha Khatri wrote:
> I had the question specific to above two cases, when the database name is
> not provided. There is no surety of having a database name same as the user
> name. Then why assume the database name and try to connect to it. Is it due
> to legacy reason or due to some common database naming practice?

so what would you prefer to do, as psql, in such case? report error
unconditionally? after all - if user didn't provide db name, and you
don't want to assume db name that is the same as user name - then you
don't know what db to connect to.

Best regards,

depesz



pgsql-novice by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: [NOVICE] Why psql connection assumes default database name as the username
Next
From: Neha Khatri
Date:
Subject: Re: [NOVICE] Why psql connection assumes default database name as the username