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

From Neha Khatri
Subject [NOVICE] Why psql connection assumes default database name as the username
Date
Msg-id CAFO0U+8P1PBd7jR3_eiYMsztRFcm59uGBJZL92P_Guag=JPf9g@mail.gmail.com
Whole thread Raw
Responses Re: [NOVICE] Why psql connection assumes default database name asthe username
List pgsql-novice
Hi,

For psql connection, the default database name is assumed to be operating system user name. Is it a common practice to have a database name same as an OS username. Or would the applications create a database with the OS username as some default procedure?

Is this assumption made so that the owners of the database can be easily classified based on the database name. Or it is for some other reason.

Without the presence of database with same name as the username, following failure is seen. 
psql: FATAL: database "pgadmin" does not exist

In my specific case the problem is just that the database 'pgadmin' is not there, then why should it be a FATAL error. I understand that any process aborting errors are treated FATAL. But it looks like a simple error here.

It will be good to understand the reason behind default database name assumption.

Regards,
Neha

pgsql-novice by date:

Previous
From: Moreno Andreo
Date:
Subject: Re: [SPAM] [NOVICE] backup task target
Next
From: hubert depesz lubaczewski
Date:
Subject: Re: [NOVICE] Why psql connection assumes default database name asthe username