File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -974,13 +974,12 @@ impl Server {
974
974
let error_message = crate :: messages:: PgErrorMsg :: parse ( & message) ?;
975
975
if error_message. message == "cached plan must not change result type" {
976
976
warn ! ( "Server {:?} changed schema, dropping connection to clean up prepared statements" , self . address) ;
977
- // This will still result in an error to the client, but this server connection
978
- // will be dropped, and will not bleed into the pool.
979
- // TODO: Other ideas to solve issues with DDL changes when using prepared statements
980
- // - Recreate connection pool to force recreation of server connections
981
- // - Just close the prepared statement instead of dropping the connection
982
- // - Implement a retry so the client doesn't see an error
983
- self . mark_bad ( ) ;
977
+ // This will still result in an error to the client, but this server connection will drop all cache prepared statements
978
+ // so that any new queries will be re-prepared
979
+ // TODO: Other ideas to solve errors when there DDL changes after a statement has been prepared
980
+ // - Recreate entire connection pool to force recreation of all server connections
981
+ // - Implement a retry (re-prepare) so the client doesn't see an error
982
+ self . cleanup_state . needs_cleanup_prepare = true ;
984
983
}
985
984
}
986
985
}
You can’t perform that action at this time.
0 commit comments