lists@xxxxxxxxx wrote:
I'm sorry, I'm confused by your reply. I may have said "table" when I meant "database". I believe it absolutely *does* make sense to connect without specifying a database first. What if you hit that edge case where there are in fact no databases? I suppose you could always run "createdb" just in case before you do anything else, but that seems counterintuitive.
that 'edge case' is one in which postgres isn't running. you have to run initdb to initialize the database cluster before you can start the postmaster. initdb creates template0, template1, and, in 8.x and newer, postgres databases
the postgres database administrator account can do... $ psql -l to list all databases, or... $ psql .... postgres=# \l or, in sql, while connected to {template1 | template0 | postgres | ... } select datname,... from pg_catalog.pg_database; -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general