Can't access to database from webapp in PostgreSQL 9.0, from shell it is Ok.

From: Andre Lopes <lopes80andre(at)gmail(dot)com>
To: postgresql Forums <pgsql-general(at)postgresql(dot)org>
Subject: Can't access to database from webapp in PostgreSQL 9.0, from shell it is Ok.
Date: 2011-12-02 23:13:41
Message-ID: CAGFRAbOtNncvPZ=kK+0mj_rwdJUtmbCk98HF0f3erBT_eaxZQg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I've installed PostgreSQL 9.0 in CentOS6 I don't have configured
anything in Postgre, I just created a user with this method:

[article]
Here is how I do to create a Postgres user with the same username as
my regular login in Linux Ubuntu.

Go to your terminal with your regular user and do:

{{{
yourusername$ sudo su - postgres
}}}

Ok, now you are as postgres user. To access to postgres do:

{{{
postgres$ psql
}}}

Now that you are in postgres terminal, do this:

{{{
postgres=# create user yourusername with createdb createrole password
'newpassword';
}}}

an then do:

{{{
postgres=# create database yourusername with owner yourusername;
}}}

And now you can do this:

{{{
postgres=# \q
postgres$ exit
yourusername$ psql
...
yourusername=# ......
}}}

Remember that this will create a postgres user with the same username
as your regular login, a password, and the privileges to create more
databases and users.
[/article]

With the method above I have no problems in enter "psql" but when I
try to connect with the user created with these method to a webapp I
got an error:

[code]
Exception Value:
FATAL: Ident authentication failed for user "mypoatgreuser"
[/code]

There is more permissions that I must to give to the user
"mypoatgreuser"? What could be wrong here?

Best Regards,

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Johnston 2011-12-02 23:28:11 Re: Can't access to database from webapp in PostgreSQL 9.0, from shell it is Ok.
Previous Message Jeff Amiel 2011-12-02 23:11:42 Re: Oddball data distribution giving me planner headaches