I use the postgres library to work with the database. I have a very large database. I need to change the character in the column. I do it like this:
void replace(String col, String from, String to) async {
String queryStr = "UPDATE $tab SET $col = replace($col, '$from', '$to');";
await connection.query(queryStr);
}
If the database has more than 1,000,000 rows, I get an error:
Unhandled exception: TimeoutException after 0:00:30.000000: Future not completed 0 _PostgreSQLConnection&Object&_PostgreSQLExecutionContextMixin._enqueue (package:postgres/src/connection.dart:402:24) 1 _PostgreSQLConnection&Object&_PostgreSQLExecutionContextMixin.query (package:postgres/src/connection.dart:318:12) 2 PG.replace (file:///home/vas/IdeaProjects/infovizion_platform/pg/bin/pg.dart:50:22) 3 main (file:///home/vas/IdeaProjects/infovizion_platform/pg/bin/main.dart:81:14) 4 _startIsolate. (dart:isolate/runtime/libisolate_patch.dart:287:32) 5 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
When I do the same requests manually there is no error.
How can I fix this?