Re: Permission Problems:-)?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jerome Lyles <susemail(at)hawaii(dot)rr(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Permission Problems:-)?
Date: 2004-01-27 16:41:14
Message-ID: 22898.1075221674@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jerome Lyles <susemail(at)hawaii(dot)rr(dot)com> writes:
> I'm trying to build a database. But none of the users I try to use works.

I think you are confused about the distinction between Postgres users
and Unix users. The set of user names known to the database doesn't
necessarily have anything to do with the set of login names available on
the local system. (If you think about cases where the database is used
by remote users, you'll see why this is a good idea.) If you want to
use database user names that match up with local user names, you have to
specifically create those database user names with the createuser
script. Initially the only user name known to the database is the
"superuser", who has the right to create more database users.

Now in order to use createuser you need to connect as the database
superuser, which seems to be a tad messed up in itself:

> I as postgresql user doesn't work:
> :~> createdb mydb
> createdb: could not connect to database template1: FATAL: user "mypostgre"
> does not exist

The name given to the initial database superuser is the name of the
account that ran initdb. It kinda looks like you changed your mind
about the name of the account owning the postgres installation --- you
seem now to be trying to connect as "mypostgre" but the database has no
such username. If you remember what you used before, you can try
createuser -U oldnamehere mypostgre
and be sure to give mypostgre all permissions that createuser asks
about. Then mypostgre will be a second superuser and you can use that
account to create more users. If you don't remember what it was before,
you may be reduced to blowing away the old installation and making a new
one (stop postmaster, rm -rf old data dir, initdb, start postmaster).

> I can only start postgresql as root.

I don't think so --- the postmaster will actively refuse to start if you
try to run it as root. Better take another look at exactly what's
happening.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-01-27 16:56:43 Re: Increase stored proc. parameters max count
Previous Message Tom Lane 2004-01-27 16:28:18 Re: Reloading Template1