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

From David G. Johnston
Subject Re: [NOVICE] Why psql connection assumes default database name as the username
Date
Msg-id CAKFQuwZLb7DSRDvQLk7KPkt-O4Z1=pvZrx56Zwa+E+D=r0q74Q@mail.gmail.com
Whole thread Raw
In response to Re: [NOVICE] Why psql connection assumes default database name as the username  (Neha Khatri <nehakhatri5@gmail.com>)
List pgsql-novice
On Thu, Mar 23, 2017 at 6:10 PM, Neha Khatri <nehakhatri5@gmail.com> wrote:

I get that. So, in current database systems, how much does this assumption weigh? Or it would be more useful update the message from

psql: FATAL: database "neha" does not exist    //Ofcourse, it won't in most cases.

to

psql: FATAL: database "neha" does not exist. Try connecting to an existing database or template database.


Introducing "template database" is probably going to cause more confusion, not less.

<database "neha" does not exist, please provide the name of one that does exist> - the last part seems somewhat self-evident ...

What you really want to say is:

FATAL: blah-blah-blah
HINT: While the database name argument is technically optional you probably want to supply one seeing as how a database with your name, i.e., the default, doesn't exist.

David J.

pgsql-novice by date:

Previous
From: Neha Khatri
Date:
Subject: Re: [NOVICE] Why psql connection assumes default database name as the username
Next
From: hubert depesz lubaczewski
Date:
Subject: Re: [NOVICE] Why psql connection assumes default database name asthe username