![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Hello all, I'm trying to create a php form for logging in to postgress with different level passwords and my first test with a superuser isn't working unless I specify a database name. I would like to allow superusers to log in without specifying a database so they can create new users, databases etc from a web interface. Does anyone see what I'm doing wrong in the following example? Thanks for any help, Ken --------------------------------------------- I defined a super user like so CREATE USER user_name CREATEUSER PASSWORD 'password' Try to log in through a web form like so: User: user_name Password: password but the connection always fails unless I specify a database. ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster |
#4
| |||
| |||
|
|
You have a conceptual error. When connecting you are connecting "to a database". With out the database you are not connecting to anything hence the failure. |
#5
| |||
| |||
|
|
On Oct 31, 2004, at 1:29 AM, Kevin Barnard wrote: You have a conceptual error. When connecting you are connecting "to a database". With out the database you are not connecting to anything hence the failure. That explains it, thanks. Another pesky problem I've run into is that I can enter literally anything into the user name and password fields of my php form and it still logs in. What's up with that? Is there some way find out the user for a given connection? |
#6
| |||
| |||
|
|
snip This is probably because pg_hba.conf settings. By default, it trusts connections from localhost, which means that any connection being made from localhost (which is the case when the web server and database are running in the same machine) will be accepted regardless of user and password. You should change these lines in pg_hba.conf local all all trust # IPv4-style local connections: host all all 127.0.0.1/32 trust and change 'trust' to your preferred auth method (password, md5, etc.) Check out the docs for authentication methods at http://www.postgresql.org/docs/7.4/interactive/client- authentication.html |
![]() |
| Thread Tools | |
| Display Modes | |
| |