21

pgAdmin dialog for adding new database connections asks for a "Maintenance DB".
In order to be able to connect, I set it to the database I want to connect (and also, I have the rights to connect).

So, why is it named "Maintenance DB" instead of "DB" or "Database"?.

11

It is worth mentioning that you are free to define any existing database in the cluster as "Maintenance DB". You are not limited to the options suggested by the interface, which are just typical defaults.

This is particularly useful for users with limited permissions or read-only access. Access to a single DB is simpler with the same DB as "Maintenance DB".

More details:
Do all users need access to the postgres database in pg_hba.conf?

What is the maintenance db? Per documentation:

The postgres database is also created when a database cluster is initialized. This database is meant as a default database for users and applications to connect to. It is simply a copy of template1 and can be dropped and recreated if necessary.

7

From the docs:

The maintenance DB field is used to specify the initial database that pgAdmin connects to, and that will be expected to have the pgAgent schema and adminpack objects installed (both optional). On PostgreSQL 8.1 and above, the maintenance DB is normally called ‘postgres’, and on earlier versions ‘template1’ is often used, though it is preferrable to create a ‘postgres’ database for this purpose to avoid cluttering the template database.

I'd add that once you are connected, it will give you list of other databases on that server you can also connect to. But until you connect to at least one database on the server, you can't fetch that list.

If it was just called "DB", that would suggest it is the only database on that server you can connect to, rather one of (potentially) several.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.