-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix client_encoding setting to support pgbouncer #823
Conversation
Hello, thank you for creating this pull request. I have automatically opened an issue http://www.doctrine-project.org/jira/browse/DBAL-1183 We use Jira to track the state of pull requests and the versions they got |
FYI -- the error you'll get when trying to connect to pgbouncer using the current release:
Again the fix is simply to pass client_encoding option directly. |
fix client_encoding setting to support pgbouncer
Thanks @rocksfrow ! |
backported to 2.5 in e25ccae |
@deeky666 no prob -- thanks for the quick merge! Would 2.5.2 be the first release that'll include this fix? |
@rocksfrow maybe a test for these options would be a good idea |
@zeroedin-bill there isn't already a postgres connection test? |
@rocksfrow I'm using postgres 9.3.4 on slackware.. |
@rocksfrow yes, but it clearly is not covering completely... |
@zeroedin-bill I'll check out the test and see if it's not using the parameters properly. |
@riccardonar I don't see how you're getting an invalid option connecting to 9.3. Can you please provide more details? Are you connecting to a connectiong manager/pooler of any sort (pg-pool,pgbouncer) or just connecting directly to tcp 5432 -- or are you connecting via socket maybe? |
I want to do a manual test and actually confirm client_encoding doesn't work on 8.x -- it might just not be in the doc. I'm definitely connecting to 9.3 with client_encoding -- but via TCP. |
@rocksfrow you are right.. my postgres client version is 9.0.4 |
@riccardonar -- lol, okay I was going to say! Alright so I am wrapping up a fix right now that will set the client encoding via the sql standard This will ensure the encoding is set properly in ALL versions. I just confirmed it works on both. |
@riccardonar I just pushed up changes to my fork. Would you be a saint and confirm it works well for you with your environment? I've confirmed it's properly setting the charset set via a manual SHOW client_encoding after connection. @deeky666 Here are my changes: rocksfrow@b8131d1 I'll create a pull request. |
@rocksfrow can you add a comment alongside that change hat explains which
|
Here is my pull request: |
@zeroedin-bill please see my pull request -- I just pushed up another commit adding details RE: client_encoding support. Is that sufficient? @riccardonar would you mind forking my repo to test these changes on your environment? https://github.com/rocksfrow/dbal |
@riccardonar I'd greatly appreciate you replying to my NEW pull request (not this one) -- and confirm the fix provided there resolves the issue you are running into. That way they can expedite the merge upstream. The pull request: #828 |
@rocksfrow your repo works fine for me! Thanks |
@riccardonar great! I am glad I was able to resolve that for you quickly -- @deeky666 let me know if there is anything else you need to happen in order On Thu, Apr 2, 2015 at 11:55 AM, riccardonar [email protected]
|
@riccardonar -- would you mind commenting on the new pull request - #825 On Thu, Apr 2, 2015 at 11:57 AM, Kyle Renfrow [email protected] wrote:
|
Thanks guys! Happy Coding. On Thu, Apr 2, 2015 at 11:58 AM, Kyle Renfrow [email protected] wrote:
|
The current release doesn't allow connecting to pgbouncer when specifying the charset due to the lack of support for the 'options' parameter. The fix is to use the client_encoding option directly instead of passing it through the options parameter.
This exact same bug was fixed in node.js's PG driver the exact same way.
brianc/node-postgres#356
I've confirmed this fix works with pgbouncer.