Re: Permission Problems:-)? - Mailing list pgsql-general

From Jerome Lyles
Subject Re: Permission Problems:-)?
Date
Msg-id 200401271413.04095.susemail@hawaii.rr.com
Whole thread Raw
In response to Re: Permission Problems:-)?  (Richard Huxton <dev@archonet.com>)
List pgsql-general
On Tuesday 27 January 2004 12:05 am, Richard Huxton wrote:

>
> OK - it's complaining it can't connect to template1. This is the database
> that contains all the default tables/types/functions etc. that will appear
> in your new database.
>
> First thing to check is that PG is running. Does it show up in "ps auxw |
> grep postgres"?
>
> If it's running you should check if you can connect to the template1
> database normally. As the postgres user try "psql template1" and see if you
> can connect to the DB. If not, you need to look at your pg_hba.conf file
> (probably in /var/lib/pgsql/data or similar) and also read the chapter on
> client authentication in the manuals (tip - start with trust for localhost
> and work outwards).
>
> If PG is running and you can connect to the template1 database, try the
> command again (as user postgres). If it still doesn't work log into
> template1 and try a "CREATE DATABASE" command (see manual for details).
> Then, come back to the list and let us know what happened.

I have now created a database as user postgre.  Thank you!

However I'm still having problems using it as a normal user.  I added myself
to the postgres user group but it didn't work.
This is my default configuration:

# CAUTION: The default configuration allows any local user to connect
# using any PostgreSQL user name, including the superuser, over either
# Unix-domain sockets or TCP/IP.

# TYPE  DATABASE    USER        IP-ADDRESS        IP-MASK           METHOD

#local   all         all                                             trust
# IPv4-style local connections:
#host    all         all         127.0.0.1         255.255.255.255   trust
# IPv6-style local connections:
#host    all         all         ::1
ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff        trust
local    all         all                                            ident
sameuser
"/var/lib/pgsql/data/pg_hba.conf" 63L, 3374C                  63,1
Bot

When I check to see if PG is running as a normal user I get this:

:~> ps auxw | grep postgres
postgres 11956  0.0  0.2 17960 2296 pts/3    S    Jan26
0:00 /usr/bin/postmaster -D /var/lib/pgsql/data
postgres 11959  0.0  0.2  8760 2072 pts/3    S    Jan26   0:00 postgres: stats
buffer process
postgres 11960  0.0  0.2  7768 2120 pts/3    S    Jan26   0:00 postgres: stats
collector process
adriel   14819  0.0  0.0  1828  604 pts/2    R    11:26   0:00 grep postgres

And when I try to create the db as a normal user I get this:

:~> createdb mydb1
createdb: could not connect to database template1: FATAL:  user "adriel" does
not exist

So...whats next?
Jerome


pgsql-general by date:

Previous
From: "William Harazim"
Date:
Subject: Manually authenticating users in pg_shadow
Next
From: "Colm De Barra"
Date:
Subject: Fw: postgres DB duplication