Re: Permissions to connect to postgres database

Lists: pgsql-general
From: "Jasbinder Bali" <jsbali(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Permissions to connect to postgres database
Date: 2006-07-27 15:32:15
Message-ID: a47902760607270832s61ae5cd8x79a73450c10788a0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi,
I have a database in postgres and i've given trusted permissions to all
making required changes
in pg_hba.conf.

Now, I'm trying to connect to the database using ECPG. Unfortunately after
EXEC SQL CONNECT dbxyz
gives me error -402 that means i don't have permissions to the database.

I'm running this ECPG code under root permissions.
Don't know what needs to be done to make it work.

Is there some kind of a script file that needs to be run
so that everything is well in place.

Regards,
~Jas


From: Richard Huxton <dev(at)archonet(dot)com>
To: Jasbinder Bali <jsbali(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Permissions to connect to postgres database
Date: 2006-07-27 15:42:25
Message-ID: 44C8DEE1.5060008@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Jasbinder Bali wrote:
> Hi,
> I have a database in postgres and i've given trusted permissions to all
> making required changes
> in pg_hba.conf.
>
> Now, I'm trying to connect to the database using ECPG. Unfortunately after
> EXEC SQL CONNECT dbxyz
> gives me error -402 that means i don't have permissions to the database.

If you turn on connection logging on the postgresql server you'll see
what's happening. Don't forget system users and postgresql users aren't
connected.

--
Richard Huxton
Archonet Ltd


From: "Jasbinder Bali" <jsbali(at)gmail(dot)com>
To: "Richard Huxton" <dev(at)archonet(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Permissions to connect to postgres database
Date: 2006-07-27 15:44:28
Message-ID: a47902760607270844t5e9f284apba45a53648e266a2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

How do i turn on the connection logging and then how do you actually check
it?

On 7/27/06, Richard Huxton <dev(at)archonet(dot)com> wrote:
>
> Jasbinder Bali wrote:
> > Hi,
> > I have a database in postgres and i've given trusted permissions to all
> > making required changes
> > in pg_hba.conf.
> >
> > Now, I'm trying to connect to the database using ECPG. Unfortunately
> after
> > EXEC SQL CONNECT dbxyz
> > gives me error -402 that means i don't have permissions to the database.
>
> If you turn on connection logging on the postgresql server you'll see
> what's happening. Don't forget system users and postgresql users aren't
> connected.
>
> --
> Richard Huxton
> Archonet Ltd
>


From: Richard Huxton <dev(at)archonet(dot)com>
To: Jasbinder Bali <jsbali(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Permissions to connect to postgres database
Date: 2006-07-27 15:50:20
Message-ID: 44C8E0BC.3010604@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Jasbinder Bali wrote:
> How do i turn on the connection logging and then how do you actually check
> it?

Log settings are in your postgresql.conf file and are detailed in this
part of the manual:
http://www.postgresql.org/docs/8.1/static/runtime-config-logging.html

Where your logfiles are stored will depend on your settings, but
typically on a unix-style system they will be in /var/log/.

I recommend you stop what you're doing for an hour or two and quickly
read through section III (Server Administration) of the manuals. That
will save you a lot of time later.

--
Richard Huxton
Archonet Ltd


From: "Shoaib Mir" <shoaibmir(at)gmail(dot)com>
To: "Richard Huxton" <dev(at)archonet(dot)com>
Cc: "Jasbinder Bali" <jsbali(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Permissions to connect to postgres database
Date: 2006-07-27 21:17:51
Message-ID: bf54be870607271417u75f556e8s42c60bac9eaeda7e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

You can turn on connection logging by setting the following in
postgresql.conf file:

log_connections = on
log_disconnections = on

and this will log all the connections and disconnections to your database
server in the db server log files.

Thanks,
--
Shoaib Mir
EnterpriseDB (www.enterprisedb.com)

On 7/27/06, Richard Huxton <dev(at)archonet(dot)com> wrote:
>
> Jasbinder Bali wrote:
> > How do i turn on the connection logging and then how do you actually
> check
> > it?
>
> Log settings are in your postgresql.conf file and are detailed in this
> part of the manual:
> http://www.postgresql.org/docs/8.1/static/runtime-config-logging.html
>
> Where your logfiles are stored will depend on your settings, but
> typically on a unix-style system they will be in /var/log/.
>
> I recommend you stop what you're doing for an hour or two and quickly
> read through section III (Server Administration) of the manuals. That
> will save you a lot of time later.
>
> --
> Richard Huxton
> Archonet Ltd
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>