Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Simple question. I have access to PostgreSQL. If I knew the name of the database I could

psql -d dbname

but if I don't know dbname, how can I list what databases are there?

share|improve this question
up vote 2 down vote accepted

Assuming you have a valid login:

psql -l

BTW, this is in the man page.

share|improve this answer
thanks. doh, the problem with postgresql is that so many functions are in other instructions, that the obvious never occurred to me – interstar Feb 4 '10 at 10:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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