are converted by default to :sql:`bytea` fields. By default data received is
returned as `!bytes`.
-.. admonition:: todo
-
- Make sure bytearry/memoryview work and are compsable with
- arrays/composite
-
If you are storing large binary data in bytea fields (such as binary documents
or images) you should probably use the binary format to pass and return
values, otherwise binary data will undergo `ASCII escaping`__, taking some CPU
cur.execute(f"select %{fmt_in} = set_byte('x', 0, %s)", (obj, i))
assert cur.fetchone()[0] is True, i
+ cur.execute(f"select %{fmt_in} = array[set_byte('x', 0, %s)]", ([obj], i))
+ assert cur.fetchone()[0] is True
+
@pytest.mark.parametrize("scs", ["on", "off"])
@pytest.mark.parametrize("pytype", [bytes, bytearray, memoryview, Binary])