Re: Installed. Now what?

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: Phoenix Kiula <phoenix(dot)kiula(at)gmail(dot)com>, Scott Mead <scottm(at)openscg(dot)com>, Marko Kreen <markokr(at)gmail(dot)com>, Amitabh Kant <amitabhkant(at)gmail(dot)com>, Tomas Vondra <tv(at)fuzzy(dot)cz>
Subject: Re: Installed. Now what?
Date: 2011-11-20 20:13:29
Message-ID: 201111201213.30376.adrian.klaver@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sunday, November 20, 2011 3:56:18 am Phoenix Kiula wrote:

> > Any ideas?
>
> Just to add, the connection string I try for pgbouncer is EXACTLY the
> same as the one I use to connect directly to PG, but I add the port
> number.

That may be the problem. The Postgres server and pgbouncer are not the same
thing. Visual aids:

Client --> pgbouncer --> Postgres server

Client credentials pgbouncer auth Postgres auth

auth file Pg pg_shadow

The authentication chain is

Client send credentials to pgbouncer.
pgbouncer checks against its list of approved users and method of
authentication.
If client passes that then pgbouncer tries to open connection to database
specified by client, using credentials listed in connection for that database in
the [databases] section of ini file.
If those credentials match those in Postgres server then a connection is
allowed.

There is nothing that says the users admitted by pgbouncer have to be the same
as those admitted by Postgres.

From what you reporting you are authenticating to pgbouncer and not to Postgres.
This was pointed out upstream by Marko. I would do a careful review of what
user you are connecting as, to each program. Also when posting the log results
please specify which program they are coming from, takes out the guess work:)

>
> For Direct PG (works) --
> pg_connect("host=localhost dbname=$db user=myuser password=mypass");
>
> For Pgbouncer (does NOT work) --
> pg_connect("host=localhost dbname=$db port=6432 user=myuser
> password=mypass");
>
> Given that both PG and postgresql are alive and kicking on 5432 and
> 6432 ports respectively, as shown in the netstat output above, I
> wonder if the connection string is the problem.

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andreas 'ads' Scherbaum 2011-11-20 22:54:45 FOSDEM 2012 - PostgreSQL Devroom: Call for Speakers
Previous Message Bill Moran 2011-11-20 19:56:01 Re: Significant Digits in Floating Point Datatype