>>> conn.execute("SELECT xpath('//title/text()', %s)", [elem]).fetchone()[0]
['Manual']
-Note that it is possible to use a `~psycopg.types.TypesRegistry`, exposed by
-any `~psycopg.abc.AdaptContext`, to obtain information on builtin types, or
-extension types if they have been registered on that context using the
-`~psycopg.types.TypeInfo`\.\ `~psycopg.types.TypeInfo.register()` method.
+.. note::
+
+ You can use a `~psycopg.types.TypesRegistry`, exposed by
+ any `~psycopg.abc.AdaptContext`, to obtain information on builtin types, in
+ the form of a `TypeInfo` object::
+
+ # Global types registry
+ >>> psycopg.adapters.types["text"]
+ <TypeInfo: text (oid: 25, array oid: 1009)>
+
+ # Types registry on a connection
+ >>> conn.adapters.types["integer"]
+ <TypeInfo: int4 (oid: 23, array oid: 1007)>
+
+ The same method can be used to get information about extension types if
+ they have been registered on that context using the
+ `~psycopg.types.TypeInfo`\.\ `~psycopg.types.TypeInfo.register()` method::
+
+ >>> (t := psycopg.types.TypeInfo.fetch(conn, "hstore"))
+ <TypeInfo: hstore (oid: 770082, array oid: 770087)>
+
+ >>> t.register() # globally
+
+ >>> psycopg.adapters.types["hstore"]
+ <TypeInfo: hstore (oid: 770082, array oid: 770087)>
.. _adapt-example-float: