Why did the authors of psql decide to have capital U (`-U`) for the user option rather than small u (`-u`)?

Viewed 48

It makes so much more sense to just use the small u -u option for the user option. All other connection options (-h, -p, -d) are lowercase. sudo command also uses lowercase -u for its user option. The lowercase -u option is not used for anything else either.

Then why?

1 Answers

See here from Postgres v7.0.0 psql. There was:

-u

Makes psql prompt for the user name and password before connecting to the database.

This option is deprecated, as it is conceptually flawed. (Prompting for a non-default user name and prompting for a password because the backend requires it are really two different things.) You are encouraged to look at the -U and -W options instead.

psql tries to maintain backwards compatibility going back a long ways. The -u option does not disappear until version 8.3. Notes for current version psql current refer to going back to version 7.4.

Related