Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.