
fidalgo
High Performance PostgreSQL for Rails: Using Advisory Locks (page 195)
@andatki
In this page, you mention:
The Transaction Pooling Mode for PgBouncer cannot be used with Advisory Locks
Can you expand a title further on this? PgBouncer is like a first resource when people run out of database connections, and now that it supports prepared statements people are much more inclined to continue to use it.
With the increase awareness of advisory locks and things like GoodJob
background job processing, are we increasing the risk of problems?
In the table for features for PGBouncer we can find some information: PgBouncer features
Do you think that having a more detailed explanation on the risks and what we should do to ensure to remain compatible (using session pooling, basically)
Even after reading the Choosing A PgBouncer Pooling Mode
in page 190 and when using GoodJob
, being the transaction mode, the most common, the user can easily fall in the trap of choosing the most common method to later release it’s not supported.
First Post!

andatki
Thanks @fidalgo. That’s a good idea to point out that possible surprise. As you noted, we can now use Prepared Statements with PgBouncer in the transaction pooling mode. But other “client features” aren’t supported, also as you noted, leaving only session mode which has less benefits. I agree it would nice to provide some warning and caution about that. I’ll follow up if I can get something included in time. Thank you!
Popular Pragmatic topics










Other popular topics









Latest in PragProg
Latest (all)
Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /js
- /rails
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /java
- /haskell
- /emacs
- /svelte
- /onivim
- /typescript
- /crystal
- /c-plus-plus
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /elm
- /ocaml
- /vscode
- /opensuse
- /ash
- /centos
- /php
- /deepseek
- /zig
- /scala
- /html
- /debian
- /nixos
- /lisp
- /agda
- /textmate
- /sublime-text
- /react-native
- /kubuntu
- /arch-linux
- /revery
- /ubuntu
- /manjaro
- /spring
- /django
- /diversity
- /nodejs
- /lua
- /slackware
- /julia
- /c
- /neovim