<@U04S8PLJWMT> how to set statement_timeout=5min i...
# ask-ai
e
@kapa.ai how to set statement_timeout=5min in the source JDBC URL Parameters
k
To set
statement_timeout=5min
in the source JDBC URL Parameters for a Postgres connector in Airbyte, you should use the
options
parameter in the JDBC URL. The correct format is:
Copy code
options=-c%20statement_timeout=5min
So, in the JDBC URL Parameters (Advanced) field, you would enter:
Copy code
options=-c%20statement_timeout=5min
If you need to add multiple parameters, separate them with
&
, for example:
Copy code
socketTimeout=600&options=-c%20statement_timeout=5min
This will set the
statement_timeout
to 5 minutes for your Postgres source connection in Airbyte. For more details, see the discussion and documentation on customizing JDBC parameters for Postgres sources in Airbyte [here](https://docs.airbyte.com/integrations/sources/postgres/postgres-troubleshooting#advanced-custom-jdbc-connection-strings) and [here](https://discuss.airbyte.io/t/1715)[^1^][^2^]. [^1^]: [Postgres Troubleshooting: Custom JDBC Connection Strings](https://docs.airbyte.com/integrations/sources/postgres/postgres-troubleshooting#advanced-custom-jdbc-connection-strings) [^2^]: [Forum Post: Source-psql hitting oom without doing anything with the data and failing](https://discuss.airbyte.io/t/1715)
e
@kapa.ai how to add idle_in_transaction_session_timeout
k
A message from kapa.ai
You can pass it via the Postgres source’s JDBC URL Parameters using the options flag: - Single parameter: - options=-c%20idle_in_transaction_session_timeout=20min - With others (use & to separate): - socketTimeout=600&options=-c%20idle_in_transaction_session_timeout=20min Enter this in the JDBC URL Parameters (Advanced) field of the Postgres source. Airbyte appends these to the JDBC URL. Note some params like user/password/ssl are managed by Airbyte and should not be set here. Also, some users reported that increasing this specific timeout via JDBC options didn’t take effect for certain scenarios; if you see the same, you may need to adjust it on the database side instead (e.g., via database parameter) as a workaround (see examples and limitations). ([Postgres source: custom JDBC params](https://docs.airbyte.com/integrations/sources/postgres/postgres-troubleshooting#advanced-custom-jdbc-connection-strings); [user report on idle timeout behavior](https://github.com/airbytehq/airbyte/issues/27715); [forum example using options with statement_timeout](https://discuss.airbyte.io/t/1715))
e
@kapa.ai add also statement_timeout in addtion
k
A message from kapa.ai
You can include both parameters in the Postgres source’s JDBC URL Parameters (Advanced) using the options flag, separating params with &:
Copy code
options=-c%20idle_in_transaction_session_timeout=20min&options=-c%20statement_timeout=5min
Alternatively, combine them in one options string (URL-encoded space between -c and each setting, and a URL-encoded space between settings is not needed when using multiple -c flags):
Copy code
options=-c%20idle_in_transaction_session_timeout=20min&options=-c%20statement_timeout=5min
Notes: - Airbyte appends these to the JDBC URL; do not include user/password/ssl keys here as they’re managed by Airbyte. ([Postgres source JDBC params](https://docs.airbyte.com/integrations/sources/postgres/postgres-troubleshooting#advanced-custom-jdbc-connection-strings)) - Some users reported idle_in_transaction_session_timeout set via JDBC options may not take effect in all cases; if so, set it at the DB level as a workaround. ([issue report](https://github.com/airbytehq/airbyte/issues/27715)) - Example usage of options with statement_timeout is documented in community guidance. ([forum example](https://discuss.airbyte.io/t/1715))