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?


Assuming you have a valid login:

psql -l

BTW, this is in the man page.

  • 1
    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 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.