Well, Hestia doesn’t remove the capital letters, PostgreSQL does it if the db name is not quoted. The problem quoting the db name to keep the db name case is that all the queries to that database must enclose the db name with quotes “Auth_pgsql_db” and that would be a problem if the software you run against the db doesn’t use them.
I wouldn’t allow capital letters in users so this won’t happen again But yes, it is a bug because recovering the db doesn’t take in account that a user can have capital letters in the name but PostgreSQL created the db name as lowercase. I’ll try to take a look but now I don’t have a machine to perform the tests.
So I attempted this workaround and created another user ‘auth’ all lowercase (side note: I had both Auth and auth as users! Not sure if it’s desirable that usernames are case sensitive)
I test out the backup and it is created with the right name.
However, the owner of all the tables in the database where changed to ‘postgres’ while they should have remained unchanged.
In my opinion, no, it isn’t desirable. I would force user names to be lowercase to avoid issues like this.
Indeed, if you use useradd there is no problem to create the user Auth but if you use adduser, you will see this message:
In Debian:
# adduser Auth
adduser: Please enter a username matching the regular expression
configured via the NAME_REGEX configuration variable. Use the
`--allow-bad-names' option to relax this check or reconfigure
NAME_REGEX in configuration.
In Ubuntu:
# adduser Auth
adduser: Please enter a username matching the regular expression configured
via the NAME_REGEX[_SYSTEM] configuration variable. Use the `--force-badname'
option to relax this check or reconfigure NAME_REGEX.
I suppose it is because there was already a user auth in PostgreSQL (remember that PostgreSQL uses lowercase for all).