irfan_alam
01/06/2021, 8:44 AMpsycopg2.errors.QueryCanceled: canceling statement due to statement timeout
I do not see any variable to set to increase statement_timeout.
Any help?douwe_maan
01/06/2021, 6:21 PMstatement_timeout
, but I think it would be pretty easy to add:
The cfg
dict in https://github.com/transferwise/pipelinewise-tap-postgres/blob/master/tap_postgres/db.py#L42 would need a new options
key with a value like -c statement_timeout=100s
. To add a new statement_timeout
setting, the code would look something like this:
statement_timeout = conn_config.get('statement_timeout')
if statement_timeout is not None:
cfg['options'] = f'-c statement_timeout={statement_timeout}s'
Are you comfortable forking the repo, making the change, and contributing it back to the main repo? To use your own fork in Meltano , see http://meltano.com/docs/plugin-management.html#using-a-custom-fork-of-a-plugin.irfan_alam
01/07/2021, 11:19 AMirfan_alam
01/07/2021, 11:19 AMdouwe_maan
01/07/2021, 2:59 PM0
(to disable the timeout completely) would be ignored, since if conn_config.get('statement_timeout')
would evaluate to if false
, since 0
is falsey!irfan_alam
01/08/2021, 3:04 AMirfan_alam
01/12/2021, 6:21 AMdouwe_maan
01/12/2021, 4:48 PMpeter_kosztolanyi
01/12/2021, 5:53 PMoptions
key to the config?
config.json:
{
"host": "x",
"port": "x",
"user": "x",
"password": "x",
"dbname": "x",
"options": [
"statement_timeout=60",
"another_option=120",
"and_another_option=180"
]
}
And in the code something like this:
cfg['options'] = ' '.join(map('-c {0}'.format, conn_config.get('options',[])))
It’s maybe more flexible, wdyt?douwe_maan
01/12/2021, 5:53 PM