diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-06-20 17:58:06 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-06-20 17:58:06 -0400 |
commit | 42bbb7163adaaa1513c7c4f5212675632be8e030 (patch) | |
tree | 8f67d356363be1ff9f8fb01cf8995c57ca060c60 /lib/sqlalchemy/dialects/postgresql/base.py | |
parent | a46932422b9bc7422e86b7d7db9fb753136730e0 (diff) | |
download | sqlalchemy-42bbb7163adaaa1513c7c4f5212675632be8e030.tar.gz |
- Added a new type :class:`.postgresql.OID` to the Postgresql dialect.
While "oid" is generally a private type within PG that is not exposed
in modern versions, there are some PG use cases such as large object
support where these types might be exposed, as well as within some
user-reported schema reflection use cases.
fixes #3002
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/base.py')
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/base.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index 42ec19c20..35f335252 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -409,6 +409,15 @@ class MACADDR(sqltypes.TypeEngine): PGMacAddr = MACADDR +class OID(sqltypes.TypeEngine): + """Provide the Postgresql OID type. + + .. versionadded:: 0.9.5 + + """ + __visit_name__ = "OID" + + class TIMESTAMP(sqltypes.TIMESTAMP): def __init__(self, timezone=False, precision=None): super(TIMESTAMP, self).__init__(timezone=timezone) @@ -1080,6 +1089,7 @@ ischema_names = { 'bit': BIT, 'bit varying': BIT, 'macaddr': MACADDR, + 'oid': OID, 'double precision': DOUBLE_PRECISION, 'timestamp': TIMESTAMP, 'timestamp with time zone': TIMESTAMP, @@ -1353,6 +1363,9 @@ class PGTypeCompiler(compiler.GenericTypeCompiler): def visit_MACADDR(self, type_): return "MACADDR" + def visit_OID(self, type_): + return "OID" + def visit_FLOAT(self, type_): if not type_.precision: return "FLOAT" |