-
-
Notifications
You must be signed in to change notification settings - Fork 478
Add idle session timeout error #963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
tokio-postgres/src/error/sqlstate.rs
Outdated
@@ -1498,6 +1503,7 @@ static SQLSTATE_MAP: phf::Map<&'static str, SqlState> = | |||
("55006", SqlState::OBJECT_IN_USE), | |||
("42P01", SqlState::UNDEFINED_TABLE), | |||
("25P03", SqlState::IDLE_IN_TRANSACTION_SESSION_TIMEOUT), | |||
("57P05", SqlState::IDLE_SESSION_TIMEOUT), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It didn't seem like there was any specific order here, so I just put this next to a similar timeout error. Let me know if I missed something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is generated by the codegen
crate in this repo. The proper way to update it is to update errcodes.txt, pg_range.dat, and pg_type.dat and cargo run
the codegen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, totally missed the comment at the top. I'll do that now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like there have been quite a few changes since this was last updated. Specifically multi-ranges causes the type gen code to panic becuase it thinks the oid is for the normal range type. I can take a look and see how we can update the code for multi-ranges. Let me know if you have any thoughts/ideas.
I copied errcodes.txt, pg_range.dat, and pg_type.dat from the 51b5834cd53f0bd068729043b55f7da3ca6bb15f commit of PostgreSQL. EDIT: I should note that the file contents are identical to commit c5dc80c1bc216f0e21a2f79f5e0415c2d4cfb35d which was the official 15.1 release. |
"r" => range_elements[&oid], | ||
"m" => multi_range_elements[&oid], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can find the description of this field in the pg_type
catalog table (https://www.postgresql.org/docs/current/catalog-pg-type.html). The relevant part is:
r for a range type, or m for a multirange type.
It looks like multirange types are currently mapping to You'll also need to run |
Just did both. Let me know if you have notes on the approach. |
@sfackler The test and clippy failures look like they're in parts of the code that I haven't touched. Any ideas what's going on? |
Those should be fixed on master now if you merge/rebase. |
LGTM otherwise! |
This commit adds the idle session timeout error (57P05). See https://www.postgresql.org/docs/current/errcodes-appendix.html
Just rebased from master |
Thanks! |
This commit adds the idle session timeout error (57P05). See https://www.postgresql.org/docs/current/errcodes-appendix.html