statement_timeout with ResultSet cursor #2873
Replies: 4 comments 3 replies
-
I presume when you use pg_stat_statement you aren't using the cursor ? |
Beta Was this translation helpful? Give feedback.
-
I think the issue is that when using a cursor we continue to issue statements. Either way, the driver doesn't really have any control on what the backend does with |
Beta Was this translation helpful? Give feedback.
-
@elahrvivaz Statement.setQueryTimeout is implemented |
Beta Was this translation helpful? Give feedback.
-
well I'm honestly not that familiar with the code, but my suspicion is that because it's a cursor it returns rather quickly and then you can fetch the results at your leisure. |
Beta Was this translation helpful? Give feedback.
-
Is there a way to enforce
statement_timeout
when returning data as a cursor? From what I can tell, the timeout is enforced correctly if I don't configure the query to use a cursor, but it is only applied to each batch of a cursor query. Usingpg_stat_statement
, the total query time exceeds thestatement_timeout
.Tested using Postgres
15
and driver version42.5.1
.Thanks,
Beta Was this translation helpful? Give feedback.
All reactions