Re: Embedded App and User Authentication
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
Home |
Main Index |
Thread Index