Search Postgresql Archives

Re: Connect without specifying a database?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[ forgot to respond to this bit... ]

"lists@xxxxxxxxx" <lists@xxxxxxxxx> writes:
> What if you hit that edge case where there are in fact no databases?

There is no such edge case.  DROP DATABASE has to be issued while
connected to some database, and it won't let you drop the DB you're
connected to.

> I suppose you could  
> always run "createdb" just in case before you do anything else, but  
> that seems counterintuitive.

And CREATE DATABASE has to be issued while connected to some database,
so createdb still has to have a default database to connect to.  There
really is no state in Postgres corresponding to "connected but not
connected to any particular database".

It does all hang together.  You will need to lose a lot of MySQL
preconceptions along the way, I fear.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux