Skip to content

Commit 4444e84

Browse files
author
James William Pye
committed
Add some oid_to_type entries for primitives.
1 parent 8aeb6d1 commit 4444e84

1 file changed

Lines changed: 22 additions & 3 deletions

File tree

postgresql/types.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
##
2-
# copyright 2008, pg/python project.
2+
# copyright 2009, James William Pye.
33
# http://python.projects.postgresql.org
44
##
5-
'PostgreSQL types and identifiers'
6-
import struct
5+
"""
6+
PostgreSQL types and identifiers
7+
"""
78
import math
89

910
InvalidOid = 0
@@ -672,6 +673,7 @@ def __iter__(self):
672673
for x in range(len(self)):
673674
yield self[x]
674675

676+
# Python Representations of PostgreSQL Types
675677
oid_to_type = {
676678
VARBITOID: varbit,
677679
BITOID: bit,
@@ -680,4 +682,21 @@ def __iter__(self):
680682
BOXOID: box,
681683
LSEGOID: lseg,
682684
CIRCLEOID: circle,
685+
686+
BOOLOID: bool,
687+
688+
VARCHAROID: str,
689+
TEXTOID: str,
690+
BPCHAROID: str,
691+
NAMEOID: str,
692+
693+
CHAROID: bytes,
694+
BYTEAOID: bytes,
695+
696+
INT2OID: int,
697+
INT4OID: int,
698+
INT8OID: int,
699+
700+
FLOAT4OID: float,
701+
FLOAT8OID: float,
683702
}

0 commit comments

Comments
 (0)