Use pg_temp instead of a transaction for test

This commit is contained in:
Steven Fackler 2016-03-05 12:49:00 -08:00
parent 0624cd6338
commit 6e4afdb377

View File

@ -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)
}