Extends or eliminates the default timeout when PostgreSQL connects to Google BigQuery through FDW, JDBC, or the REST API.
BigQuery terminates idle sessions after roughly 10 minutes, while PostgreSQL clients often default to 15–30 seconds for establishing a TCP handshake. Slow networks, large SSL handshakes, or heavy authentication can exceed either limit, triggering a timeout.
Add or update the connection_timeout
option on the foreign server. Values are in seconds, and 0 disables the limit. Restart existing sessions to apply the change.
Append timeout=NNN
(connect) and readTimeout=NNN
(I/O) to your jdbc:bigquery://
URI. This works for psql + JDBC, Spring, and DBT runners.
BigQuery limits interactive query execution to 6 hours. Use EXECUTE IMMEDIATE
jobs when calling from FDW, or split large aggregations into materialised tables to avoid server-side cancellation.
connection_timeout
> 60 s to cover TLS negotiation.statement_timeout
separately; it does not fix connection issues.No. The value only defines how long the client waits for the connection or first byte. Normal query speed is unaffected.
Yes. Use SET bigquery.connection_timeout = '90'
right after connecting if your FDW exposes a GUC, or supply a different JDBC URL for each job runner.
BigQuery itself has no documented hard cap, but most client libraries cap at 600 s. Values above that may be ignored.