are not found (:ticket:`#473`).
- Set `Cursor.rowcount` to the number of rows of each result set from
`~Cursor.executemany()` when called with `!returning=True` (:ticket:`#479`).
+- Fix `TypeInfo.fetch()` when used with `ClientCursor` (:ticket:`#484`).
Current release
---------------
# or intrans)
try:
with conn.transaction():
- with conn.cursor(binary=True, row_factory=dict_row) as cur:
+ with conn.cursor(row_factory=dict_row) as cur:
cur.execute(cls._get_info_query(conn), {"name": name})
recs = cur.fetchall()
except e.UndefinedObject:
) -> Optional[T]:
try:
async with conn.transaction():
- async with conn.cursor(binary=True, row_factory=dict_row) as cur:
+ async with conn.cursor(row_factory=dict_row) as cur:
await cur.execute(cls._get_info_query(conn), {"name": name})
recs = await cur.fetchall()
except e.UndefinedObject:
from psycopg import sql, rows
from psycopg.adapt import PyFormat
from psycopg.postgres import types as builtins
+from psycopg.types import TypeInfo
from .utils import gc_collect, gc_count
from .test_cursor import my_row_factory
assert cur.fetchone() == ("test",)
assert not notices
+
+
+def test_typeinfo(conn):
+ info = TypeInfo.fetch(conn, "jsonb")
+ assert info is not None
import psycopg
from psycopg import sql, rows
from psycopg.adapt import PyFormat
+from psycopg.types import TypeInfo
from .utils import alist, gc_collect, gc_count
from .test_cursor import my_row_factory
assert (await cur.fetchone()) == ("test",)
assert not notices
+
+
+async def test_typeinfo(aconn):
+ info = await TypeInfo.fetch(aconn, "jsonb")
+ assert info is not None