Thread: setting login database

setting login database

From
Samatha Kottha
Date:
Hi,

I am very new to postgres. So, if I am asking stupid question please
forgive me. I installed the postgres, imported the required databases
and created the necessary users. When users login using psql, they are
required to supply the database name.

We are trying to access a postgres database using a data integration
tool. This data integration tool have options to specify the hostname,
port, userid, and passwd of a database. But there is no way to supply
the database name. So, I am thinking to set the database name to each
user (default login database) so that they do not need to supply that
info when they access data using data integration tool.

How can I accomplish that?

Thank you.

Cheers,
Samatha

--
Samatha Kottha
Zentrum für Informationsdienste und Hochleistungsrechnen (ZIH)
Technische Universität Dresden            Tel: (+49) 351 463-38776
Room 1019                    Fax: (+49) 351 463-38245
Noethnitzer Straße 46
01187 Dresden
Germany


Re: setting login database

From
Michael Fuhr
Date:
On Thu, Jun 07, 2007 at 03:38:15PM +0200, Samatha Kottha wrote:
> We are trying to access a postgres database using a data integration
> tool. This data integration tool have options to specify the hostname,
> port, userid, and passwd of a database. But there is no way to supply
> the database name.

What data integration tool is it?  Are you sure it doesn't have an
option to specify the database?

> So, I am thinking to set the database name to each user (default
> login database) so that they do not need to supply that info when
> they access data using data integration tool.

In libpq applications a role's default database has the same name
as the role; you can override that with the PGDATABASE environment
variable.

http://www.postgresql.org/docs/8.2/interactive/libpq-envars.html

See also PGSERVICE, PGSYSCONFDIR, and the connection service file.

http://www.postgresql.org/docs/8.2/interactive/libpq-pgservice.html

--
Michael Fuhr

Re: setting login database

From
Samatha Kottha
Date:
Hi Michael,

Thank you for the tip. The integration tool is OGSA-DAI. Of course, we
have to specify the database but the connection string that it uses does
not contain it.

Cheers,
Samatha

Michael Fuhr wrote:
> On Thu, Jun 07, 2007 at 03:38:15PM +0200, Samatha Kottha wrote:
>
>> We are trying to access a postgres database using a data integration
>> tool. This data integration tool have options to specify the hostname,
>> port, userid, and passwd of a database. But there is no way to supply
>> the database name.
>>
>
> What data integration tool is it?  Are you sure it doesn't have an
> option to specify the database?
>
>
>> So, I am thinking to set the database name to each user (default
>> login database) so that they do not need to supply that info when
>> they access data using data integration tool.
>>
>
> In libpq applications a role's default database has the same name
> as the role; you can override that with the PGDATABASE environment
> variable.
>
> http://www.postgresql.org/docs/8.2/interactive/libpq-envars.html
>
> See also PGSERVICE, PGSYSCONFDIR, and the connection service file.
>
> http://www.postgresql.org/docs/8.2/interactive/libpq-pgservice.html
>
>


--
Samatha Kottha
Zentrum für Informationsdienste und Hochleistungsrechnen (ZIH)
Technische Universität Dresden            Tel: (+49) 351 463-38776
Room 1019                    Fax: (+49) 351 463-38245
Noethnitzer Straße 46
01187 Dresden
Germany


Re: setting login database

From
Samatha Kottha
Date:
OK, I am not yet awake :-) Of course, the connection string has database
name but some thing is not working on OGSA-DAI side. It is giving
authorisation failure error!

Samatha

Samatha Kottha wrote:
> Hi Michael,
>
> Thank you for the tip. The integration tool is OGSA-DAI. Of course, we
> have to specify the database but the connection string that it uses does
> not contain it.
>
> Cheers,
> Samatha
>
> Michael Fuhr wrote:
>
>> On Thu, Jun 07, 2007 at 03:38:15PM +0200, Samatha Kottha wrote:
>>
>>
>>> We are trying to access a postgres database using a data integration
>>> tool. This data integration tool have options to specify the hostname,
>>> port, userid, and passwd of a database. But there is no way to supply
>>> the database name.
>>>
>>>
>> What data integration tool is it?  Are you sure it doesn't have an
>> option to specify the database?
>>
>>
>>
>>> So, I am thinking to set the database name to each user (default
>>> login database) so that they do not need to supply that info when
>>> they access data using data integration tool.
>>>
>>>
>> In libpq applications a role's default database has the same name
>> as the role; you can override that with the PGDATABASE environment
>> variable.
>>
>> http://www.postgresql.org/docs/8.2/interactive/libpq-envars.html
>>
>> See also PGSERVICE, PGSYSCONFDIR, and the connection service file.
>>
>> http://www.postgresql.org/docs/8.2/interactive/libpq-pgservice.html
>>
>>
>>
>
>
>


--
Samatha Kottha
Zentrum für Informationsdienste und Hochleistungsrechnen (ZIH)
Technische Universität Dresden            Tel: (+49) 351 463-38776
Room 1019                    Fax: (+49) 351 463-38245
Noethnitzer Straße 46
01187 Dresden
Germany


Re: setting login database

From
Michael Fuhr
Date:
On Fri, Jun 08, 2007 at 09:50:10AM +0200, Samatha Kottha wrote:
> OK, I am not yet awake :-) Of course, the connection string has database
> name but some thing is not working on OGSA-DAI side. It is giving
> authorisation failure error!

What's the exact error message?  Is the authorization failure coming
from the database?  What do the database logs show?  Are you sure
you're using the correct username and password?  What do you have
in pg_hba.conf?

--
Michael Fuhr