Re: Embedded App and User Authentication

From: "Jeffrey J(dot) Early" <jearly(at)alum(dot)ups(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: John DeSoi <desoi(at)pgedit(dot)com>, "pgsql-admin(at)postgresql(dot)org Admin" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Embedded App and User Authentication
Date: 2006-08-31 20:05:08
Message-ID: C11C8F04.10F92%jearly@alum.ups.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

on 8/31/06 12:53 PM, Tom Lane at tgl(at)sss(dot)pgh(dot)pa(dot)us wrote:

> "Jeffrey J. Early" <jearly(at)alum(dot)ups(dot)edu> writes:
>> It turns out the problem is with launching postmaster via pg_ctl -- in fact,
>> pg_ctl seems to do this user authentication test, but postmaster doesn't. So
>> I found that if I launch postmaster directly, no problem. Nice security :-)
>
> The postmaster may start fine, but are you able to log in? The initial
> superuser account is still going to have the old username, so you might
> have some issues around obtaining superuser privileges.
>
> regards, tom lane

Seems to work okay. I just successfully embedded it in my app and ran it on
a different machine with a different username.

I can start postmaster, and login with no problems. When I login I can just
specify the user that I want to login as.

Basic process is this:

1. initdb -D data -U genericuser

2. nohup postmaster -D data >postgres.log 2>&1 </dev/null &

3. createdb test -U genericuser

4. psql -d test -f data.sql -U genericuser > loaddata.log

5. psql -d test -U genericuser

So if you replace step 2 with:

pg_ctl start -w -D $data -s -l postgres.log

Then the database won't start and this won't work. But otherwise I seem to
have completely access as I need it on any and all machines.

Jeffrey

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2006-08-31 20:19:35 Re: archive logs recovery
Previous Message Tom Lane 2006-08-31 19:53:39 Re: Embedded App and User Authentication