building connection string with options fails with pgbouncer #270

Closed
wdolek opened this Issue Feb 14, 2013 · 8 comments

Comments

4 participants

wdolek commented Feb 14, 2013

lib/connection-parameters.js
line 64: params.push("options=--client_encoding='utf-8'");

this causes our pgbouncer to fail with error: "Unsupported startup parameter: options"

why is it there? :)

Owner

brianc commented Feb 15, 2013

related to this pull request: #253

Perhaps we need to make the 'utf8' setting option opt in instead of automatic?

Owner

brianc commented Feb 23, 2013

I do believe the options=--client_encoding='utf-8' is a valid startup parameter for a client. Do you think this might be a bug in pgbouncer?

Connecting with psql: psql -p 6432 te_dev te_dev

2013-02-27 20:14:17.713 76311 LOG process up: pgbouncer 1.5.2, libevent 1.4.14b-stable (kqueue), adns: compat
2013-02-27 20:14:58.615 76311 LOG C-0x2845c008: te_dev/te_dev@unix:6432 login attempt: db=te_dev user=te_dev
2013-02-27 20:14:58.615 76311 LOG S-0x28460008: te_dev/te_dev@127.0.0.1:5432 new connection to server
2013-02-27 20:15:01.275 76311 LOG C-0x2845c008: te_dev/te_dev@unix:6432 closing because: client close request (age=2)
2013-02-27 20:15:17.715 76311 LOG Stats: 0 req/s, in 0 b/s, out 0 b/s,query 0 us

Connecting with node.pg:

2013-02-27 20:15:32.209 76311 WARNING C-0x2845c008: (nodb)/(nouser)@127.0.0.1:51439 unsupported startup parameter: options=--client_encoding='utf-8'
2013-02-27 20:15:32.209 76311 LOG C-0x2845c008: (nodb)/(nouser)@127.0.0.1:51439 closing because: Unsupported startup parameter: options (age=0)
2013-02-27 20:15:32.209 76311 WARNING C-0x2845c008: (nodb)/(nouser)@127.0.0.1:51439 Pooler Error: Unsupported startup parameter: options
2013-02-27 20:16:17.716 76311 LOG Stats: 0 req/s, in 0 b/s, out 0 b/s,query 0 us
2013-02-27 20:17:17.717 76311 LOG Stats: 0 req/s, in 0 b/s, out 0 b/s,query 0 us
2013-02-27 20:18:17.718 76311 LOG Stats: 0 req/s, in 0 b/s, out 0 b/s,query 0 us
2013-02-27 20:19:17.719 76311 LOG Stats: 0 req/s, in 0 b/s, out 0 b/s,query 0 us
2013-02-27 20:20:17.720 76311 LOG Stats: 0 req/s, in 0 b/s, out 0 b/s,query 0 us
2013-02-27 20:21:17.721 76311 LOG Stats: 0 req/s, in 0 b/s, out 0 b/s,query 0 us
2013-02-27 20:22:17.722 76311 LOG Stats: 0 req/s, in 0 b/s, out 0 b/s,query 0 us

My configuration: freebsd 9.0, postgresql 9.2, pgbouncer 1.5.2, nodejs 0.8.20, pg 0.13.1

Contributor

strk commented Apr 3, 2013

Seems to be by design that pgpool refuses options (as they'd be per-session and not working for a pooled architecture):
http://lists.pgfoundry.org/pipermail/pgbouncer-general/2011-August/000843.html

+1 for making it optional

Contributor

strk commented Apr 3, 2013

Another idea seems to be replacing "options=--client_encoding='utf-8'" with "client_encoding='utf-8'", as it's been reported that pg_bouncer would accept the latter just fine.
REF: http://lists.pgfoundry.org/pipermail/pgbouncer-general/2008-November/000307.html

@wdolek do you confirm it works ?

Contributor

strk commented Apr 3, 2013

I could test this myself, and it works. Now working on a pull request.

Contributor

strk commented Apr 3, 2013

It acually seems to be fixed in master, so no need to pull anything. I think this issue can be closed.

strk pushed a commit to CartoDB/node-postgres that referenced this issue Apr 3, 2013

Hebo added a commit to Hebo/node-postgres that referenced this issue May 21, 2013

brianc added a commit that referenced this issue May 23, 2013

Merge pull request #356 from Hebo/pgbouncer_encoding_libpq_fix
Fix client_encoding setting to support pg_bouncer when using libpq (#270)
Owner

brianc commented Jun 30, 2013

This should be fixed now.

@brianc brianc closed this Jun 30, 2013

@etehtsea etehtsea referenced this issue in headius/jruby-pg Jun 1, 2015

Merged

Make options params optional #21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment