Use pg_temp instead of a transaction for test
This commit is contained in:
parent
0624cd6338
commit
6e4afdb377
@ -857,17 +857,15 @@ fn test_generic_connection() {
|
||||
#[test]
|
||||
fn test_custom_range_element_type() {
|
||||
let conn = or_panic!(Connection::connect("postgres://postgres@localhost", SslMode::None));
|
||||
let trans = or_panic!(conn.transaction());
|
||||
or_panic!(trans.execute("CREATE TYPE floatrange AS RANGE (
|
||||
or_panic!(conn.execute("CREATE TYPE pg_temp.floatrange AS RANGE (
|
||||
subtype = float8,
|
||||
subtype_diff = float8mi
|
||||
)", &[]));
|
||||
let stmt = or_panic!(trans.prepare("SELECT $1::floatrange"));
|
||||
let stmt = or_panic!(conn.prepare("SELECT $1::floatrange"));
|
||||
match &stmt.param_types()[0] {
|
||||
&Type::Other(ref u) => {
|
||||
assert_eq!("floatrange", u.name());
|
||||
assert_eq!(&Kind::Range(Type::Float8), u.kind());
|
||||
assert_eq!("public", u.schema());
|
||||
}
|
||||
t => panic!("Unexpected type {:?}", t)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user