Is there some kind of mapping a data type's oid to its name?
See original GitHub issueDriver version
2.0.905
Redshift version
PostgreSQL 8.0.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3), Redshift 1.0.36224��
Client Operating System
Darwin Nativs-MacBook-Pro.local 21.4.0 Darwin Kernel Version 21.4.0: Mon Feb 21 20:34:37 PST 2022; root:xnu-8020.101.4~2/RELEASE_X86_64 x86_64
Python version
3.8.7
Problem description
I was wondering if there is some a way for to convert a data type type_oid
into string instead.
cursor.execute("SELECT int_col from some_table")
description = cursor.description
oid = description[0][1]
print(oid) # will print oid. for the sake of example let's say it's 1
print(some_func(oid)). # "int"
in psycopg2 there is the https://www.psycopg.org/docs/extensions.html#psycopg2.extensions.string_types
so I’m looking for something similar, but for redshift data types.
Thanks in advance!
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Documentation: 15: 8.19. Object Identifier Types - PostgreSQL
Object identifiers (OIDs) are used internally by PostgreSQL as primary keys for various system tables. Type oid represents an object identifier. There are ......
Read more >ArcGIS field data types
The types are matched to the closest data type available in the DBMS. This process is referred to as data type mapping.
Read more >Elasticsearch Mapping Basics & Examples (After Create Index)
First, let's look at indexing according to document type. Indices are independent from one another, so you can use the same name for...
Read more >Data Type Mapping between Active Directory and LDAP
Friendly syntax name LDAP syntax OID ADSTYPEENUM data type
AccessPointDN 1.3.6.1.4.1.1466.115.121.1.2 ADSTYPE_CASE_IGNORE_STRING
AttributeTypeDescription 1.3.6.1.4.1.1466.115.121.1.3 ADSTYPE_CASE_IGNORE_STRING
Audio 1.3.6.1.4.1.1466.115.121.1.4 ADSTYPE_OCTET_STRING
Read more >3 Defining Object Types for Data Cartridges
Each type has an OID . If you create an object type and do not specify an OID , Oracle generates an OID...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @ni-todo-spot – we’ve just released v2.0.908 which includes support for this feature as noted above.
I’ll be closing this issue but feel free to open a new one if you see any issue with this feature or need any help. Thanks again for working with us to improve redshift-connector! 😃
Hey @ni-todo-spot,
To clarify my second comment a bit, these IN/OUT function mappings are defined for Redshift, not postgres despite their name starting with
pg_
(we need to fix this, I’m hoping to fit in our next release).I took a look into implementing this yesterday and came up with an approach using
IntEnum
that will provide the desired functionality and clean up our codebase a bit. Here’s an example of how it will workWe should be able to get this in our release scheduled for July 😃