You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several types found in pg_catalog are not mapped to Python types.
We should introduce a psycopg.types.catalog module implementing mappings:
oid: uint32 (already implemented in psycopg.types.numeric).
cid: uint32
int2vector: similar to smallint[], with space-separated text representation, 0-based array binary representation.
oidvector: similar to int[], see int2vector
tid: pair (block, offset) (uint32, uint16)
xid: uint32
xid8: uint64
pg_lsn: uint64
This query gives an overview of where the types are used:
select a.atttypid::regtype, relname, attname from pg_attribute a join pg_class c on a.attrelid = c.oid join pg_namespace s on s.oid = c.relnamespace where nspname = 'pg_catalog' order by a.atttypid::regtype::text, relname, attname;
The text was updated successfully, but these errors were encountered:
this means that, if we dump an object to a cid (for instance querying select * from pg_class where cmin = %s) then we cannot dump the type as a number: it must be either unknown or cid.
The model I had in mind was the same of oid, but oids have more casts and operators to support mixing with numbers.
If this is the case, if loading a cid returns a Python integer, then loading it back we would need a Cid wrapper. The Oid doesn't normally need such wrapper.
Uhm... I'm questioning if this would be useful at all, or for every type, or in both directions...
Several types found in pg_catalog are not mapped to Python types.
We should introduce a
psycopg.types.catalog
module implementing mappings:oid
:uint32
(already implemented inpsycopg.types.numeric
).cid
:uint32
int2vector
: similar tosmallint[]
, with space-separated text representation, 0-based array binary representation.oidvector
: similar toint[]
, see int2vectortid
: pair(block, offset)
(uint32
,uint16
)xid
:uint32
xid8
:uint64
pg_lsn
:uint64
This query gives an overview of where the types are used:
select a.atttypid::regtype, relname, attname from pg_attribute a join pg_class c on a.attrelid = c.oid join pg_namespace s on s.oid = c.relnamespace where nspname = 'pg_catalog' order by a.atttypid::regtype::text, relname, attname;
The text was updated successfully, but these errors were encountered: