Skip to content

Commit b112905

Browse files
author
James William Pye
committed
Add standard types to the mapping.
1 parent fd3fe6b commit b112905

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

postgresql/types.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
PostgreSQL types and identifiers
77
"""
88
import math
9+
import decimal
910
import datetime
1011
try:
1112
import xml.etree.cElementTree as etree
@@ -729,12 +730,17 @@ def __iter__(self):
729730
BPCHAROID: str,
730731
NAMEOID: str,
731732

733+
# XXX: should reflect any changes that a user may have invoked.
734+
XMLOID: etree.ElementTree,
735+
736+
# This is *not* bpchar, the SQL CHARACTER type.
732737
CHAROID: bytes,
733738
BYTEAOID: bytes,
734739

735740
INT2OID: int,
736741
INT4OID: int,
737742
INT8OID: int,
743+
NUMERICOID: decimal.Decimal,
738744

739745
FLOAT4OID: float,
740746
FLOAT8OID: float,
@@ -746,4 +752,9 @@ def __iter__(self):
746752
TIMETZOID: datetime.time,
747753

748754
INTERVALOID: datetime.timedelta,
755+
756+
RECORDOID : tuple,
757+
ANYARRAYOID : list,
758+
ANYELEMENTOID : str,
759+
ANYENUMOID : int,
749760
}

0 commit comments

Comments
 (0)