You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have recently been getting hit by the following error: "cached plan must not change result type (SQLSTATE 0A000)" and i found some recent PRs that addressed it #865 and corresponding pgconn pr. I saw the notes in these PRs as well as the original issue #841 where its mentioned: "We don't try to get fancy with retries or anything like that, just return the error and allow the application to handle it.".
Im struggling to understand how to handle the error, my application is fairly flexible in what could be done to fix the query, so here are a few questions:
Where does this error come out from my point of view? From the Query call: conn.Query("") or the rows.Next ?
for rows.Next() {
var err = rows.Err()
if err != nil {
...
}
I think i read in one of the issues that 0A000 is used for multiple types of errors so should i be inspecting the text of the error via this ?
Once I've trapped the error, I need to clear the statement cache, correct? If so can i run conn.StatementCache().Clear() and then retry the query? Or is there something more that needs to be done?
thank you in advance for your help.
The text was updated successfully, but these errors were encountered:
It's an implementation detail whether an error is returned immediately by Query or is only available in rows.Err() after the query is complete. Any error that occurs will be available in rows.Err() at the end so I typically handle errors there.
I have recently been getting hit by the following error: "cached plan must not change result type (SQLSTATE 0A000)" and i found some recent PRs that addressed it #865 and corresponding pgconn pr. I saw the notes in these PRs as well as the original issue #841 where its mentioned: "We don't try to get fancy with retries or anything like that, just return the error and allow the application to handle it.".
Im struggling to understand how to handle the error, my application is fairly flexible in what could be done to fix the query, so here are a few questions:
conn.Query("")
or the rows.Next ?thank you in advance for your help.
The text was updated successfully, but these errors were encountered: