Re: Post Install / Secure PostgreSQL - Mailing list pgsql-general

From Carlos Mennens
Subject Re: Post Install / Secure PostgreSQL
Date
Msg-id AANLkTikgb8VJ3d5r7P6gsGNHYmH=1z4e_N_N5HF=wqv8@mail.gmail.com
Whole thread Raw
In response to Re: Post Install / Secure PostgreSQL  (Craig Ringer <craig@postnewspapers.com.au>)
Responses Re: Post Install / Secure PostgreSQL  (John R Pierce <pierce@hogranch.com>)
List pgsql-general
Thanks all for the help! I have a much better understanding now of how
user accounts are managed via ident authentication.

The only thing I have yet to figure out or understand is how to login
to PostgreSQL as my user account but not to any specific database. I
understand that when I am logged in as my user account, I can simply
login using:

psql -U cmennens <database_name> (I know I can omit the '-U cmennens'
if I am 'cmennens' via Linux shell)

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?

When I do the following, it works but I think only because it's using
ident credentials and then connects automatically to the 'postgres'
database. I could be wrong however...

[postgres@db1 ~]$ psql
psql (8.4.4)
Type "help" for help.

postgres=# \d
No relations found.
postgres=# \dt
No relations found.
postgres=# \c postgres
psql (8.4.4)
You are now connected to database "postgres".
postgres=# \dt
No relations found.
postgres=# \d

From the above I login as 'postgres' but don't specify a specific
database to connect to. Is this possible to do as my user 'cmennens'
who is listed as a super user?

Also from above, if I connect to the 'postgres' database as 'postgres'
user, why can I not list any tables above? I keep getting "No
relations found."?

pgsql-general by date:

Previous
From: Michael Hull
Date:
Subject: Using libpq, floats and binary data
Next
From: John R Pierce
Date:
Subject: Re: Post Install / Secure PostgreSQL