You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "lupko (via GitHub)" <gi...@apache.org> on 2025/01/14 12:46:21 UTC

[I] python/c: postgresql handling of unknown types broken in 1.3? [arrow-adbc]

lupko opened a new issue, #2448:
URL: https://github.com/apache/arrow-adbc/issues/2448

   ### What happened?
   
   Hi,
   
   There appears to be a regression in PostgreSQL driver between 1.3.0 and 1.2.0 when it comes to handling unknown types. 
   
   - In 1.2.0, things work as documented here: https://arrow.apache.org/adbc/main/driver/postgresql.html#unknown-types; type is binary, there is field-level metadata with the actual PG type name. 
   
   - In 1.3.0, the `NotSupportedError` flies instead
   
   I have attached quick repro that queries pg catalog table with one of the unknown types. The
   
   ### Stack Trace
   
   ```
   Traceback (most recent call last):
     File "...", line 17, in main
       cursor.execute("SELECT * FROM pg_type WHERE oid <= 6157")
     File ".../.venv/lib64/python3.12/site-packages/adbc_driver_manager/dbapi.py", line 698, in execute
       handle, self._rowcount = _blocking_call(
                                ^^^^^^^^^^^^^^^
     File "adbc_driver_manager/_lib.pyx", line 1573, in adbc_driver_manager._lib._blocking_call_impl
     File "adbc_driver_manager/_lib.pyx", line 1566, in adbc_driver_manager._lib._blocking_call_impl
     File "adbc_driver_manager/_lib.pyx", line 1217, in adbc_driver_manager._lib.AdbcStatement.execute_query
     File "adbc_driver_manager/_lib.pyx", line 260, in adbc_driver_manager._lib.check_error
   adbc_driver_manager.NotSupportedError: NOT_IMPLEMENTED: [libpq] Column #32 ("typacl") has unknown type code 1034
   ```
   
   ### How can we reproduce the bug?
   
   ```
   from adbc_driver_postgresql import dbapi
   import adbc_driver_manager.dbapi as adbc
   import pyarrow
   
   USERNAME = ""
   PASSWORD = ""
   HOST = "localhost"
   PORT = 5432
   DATABASE = ""
   
   def main():
       c: adbc.Connection = dbapi.connect(
           f"postgresql://{USERNAME}:{PASSWORD}@{HOST}:{PORT}/{DATABASE}"
       )
   
       cursor = c.cursor()
       cursor.execute("SELECT * FROM pg_type WHERE oid <= 6157", ())
       print(cursor.fetch_arrow_table())
   
   
   if __name__ == "__main__":
       main()
   ```
   
   ### Environment/Setup
   
   Python 3.12
   adbc-driver-postgresql==1.3.0
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] python/c: postgresql handling of unknown types broken in 1.3? [arrow-adbc]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #2448:
URL: https://github.com/apache/arrow-adbc/issues/2448#issuecomment-2591369383

   So probably we should return `arrow.opaque` here


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] python/c: postgresql handling of unknown types broken in 1.3? [arrow-adbc]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #2448:
URL: https://github.com/apache/arrow-adbc/issues/2448#issuecomment-2589913684

   Let me investigate this tomorrow and then hopefully we can fix for 1.4.0 RC2 (since the release got overridden by the Arrow release anyways)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] python/c: postgresql handling of unknown types broken in 1.3? [arrow-adbc]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm closed issue #2448: python/c: postgresql handling of unknown types broken in 1.3?
URL: https://github.com/apache/arrow-adbc/issues/2448


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] python/c: postgresql handling of unknown types broken in 1.3? [arrow-adbc]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #2448:
URL: https://github.com/apache/arrow-adbc/issues/2448#issuecomment-2591368210

   It seems it's https://github.com/apache/arrow-adbc/pull/2219#discussion_r1828624368


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] python/c: postgresql handling of unknown types broken in 1.3? [arrow-adbc]

Posted by "paleolimbot (via GitHub)" <gi...@apache.org>.
paleolimbot commented on issue #2448:
URL: https://github.com/apache/arrow-adbc/issues/2448#issuecomment-2590339978

   I think I changed the query used to list the types when I added Redshift support, which almost certainly resulted in that type not being in the resolver:
   
   https://github.com/apache/arrow-adbc/blob/ed18b8b221af23c7b32312411da10f6532eb3488/c/driver/postgresql/database.cc#L265-L276


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] python/c: postgresql handling of unknown types broken in 1.3? [arrow-adbc]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #2448:
URL: https://github.com/apache/arrow-adbc/issues/2448#issuecomment-2603444955

   @lupko I've just uploaded 1.4.0 to PyPI


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org