Skip to content

Commit 949f655

Browse files
committed
fix: exclude pooler from statement_timeout
1 parent 70c38c0 commit 949f655

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/server/utils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ export const extractRequestForLogging = (request: FastifyRequest) => {
2626
export function createConnectionConfig(request: FastifyRequest): PoolConfig {
2727
const connectionString = request.headers.pg as string
2828
const config = { ...DEFAULT_POOL_CONFIG, connectionString }
29+
// For pooler connections like pgbouncer, statement_timeout isn't supported
30+
if (config.port !== 5432) {
31+
config.statement_timeout = undefined
32+
}
2933

3034
// Override application_name if custom one provided in header
3135
if (request.headers['x-pg-application-name']) {

0 commit comments

Comments
 (0)