John R Pierce <pierce@hogranch.com> writes:
> On 09/15/10 10:00 AM, Carlos Mennens wrote:
>> But when if 'cmennens' wants to login to PostgreSQL but not connect to
>> any specific database? I know in MySQL you can login to the MySQL
>> server CLI but not be attached to any specific database if you want to
>> just peek around and do basic administrative tasks. Is this possible
>> in PostgreSQL?
> no, there is no such state in postgres. you connect and log into a
> database. connecting to a different database requires closing that
> connection and opening a new one (which is what the \c command does in
> psql).
It might be worth pointing out that what mysql calls a database is more
or less what we call a schema; there isn't any close equivalent in mysql
to a Postgres installation with multiple databases. The initial state
in mysql is about like having an empty search_path in PG: you can get at
all tables in the database, you just have to qualify their names
explicitly. And "USE database" corresponds to a "SET search_path"
operation.
regards, tom lane