We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Overview:
It seems that postgres "regclass" is not convertible to native rust strings.
Triage:
I was trying to fetch an array of columns for a table where primary keys are indexed using the following snippet:
// ... some function above let table_indexed_attributes_query = r#" SELECT array_agg(a.attname) FROM pg_index i JOIN pg_attribute a ON a.attrelid = i.indrelid AND a.attnum = ANY(i.indkey) WHERE i.indrelid = $1::regclass AND i.indisprimary; "#; let result_indexed_attributes = client.borrow_mut().query(table_indexed_attributes_query, &[&table_name]).unwrap(); let indexed_attributes = match result_indexed_attributes.get(0) { Some(indexed_attributes) => { let data: String = indexed_attributes.get(0); let indexed_columns = data.split(",") .map(|s| s.to_string()) .collect(); indexed_columns } None => vec![], };
While running, I am getting the following error:
called `Result::unwrap()` on an `Err` value: Error { kind: ToSql(0), cause: Some(WrongType { postgres: Regclass, rust: "alloc::string::String" }) }
Question:
While I can't convert regclass to String, is there any rust native object I could convert it into? If not, I'd like to help build support for this.
regclass
String
The text was updated successfully, but these errors were encountered:
Apologies: I noticed that the issue not the conversation from regclass to String, rather it's the other way around.
Sorry, something went wrong.
See #1041
No branches or pull requests
Overview:
It seems that postgres "regclass" is not convertible to native rust strings.
Triage:
I was trying to fetch an array of columns for a table where primary keys are indexed using the following snippet:
While running, I am getting the following error:
Question:
While I can't convert
regclass
toString
, is there any rust native object I could convert it into? If not, I'd like to help build support for this.The text was updated successfully, but these errors were encountered: