-
|
I'm looking to query int2vector fields in PostgreSQL (and specifically those in pg_catalog, and specifically indoption from pg_index https://www.postgresql.org/docs/current/catalog-pg-index.html) However, if I run: import adbc_driver_postgresql.dbapi
with adbc_driver_postgresql.dbapi.connect("postgresql://postgres:[email protected]:5432/") as conn:
with conn.cursor() as cursor:
cursor.execute("SELECT indoption FROM pg_index LIMIT 1")
print(cursor.fetchall())Then I get something that I'm not quite sure how to use: Running the same query using psycopg results in And using psql: How can I get a non binary results from int2vector fields, similar to psql or psycopg? (Including maybe, how to adjust the query?) Context - I'm making a SQLAlchemy dialect for ADBC, and especially would like to support its reflection capabilities, so querying the catalogue, including its int2vector fields, is needed for this |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I have found that you can manipulate the result in SQL, and get an SELECT string_to_array(indoption::text, ' ')::int[] FROM pg_index LIMIT 1Which then seems to behave much like psycopg |
Beta Was this translation helpful? Give feedback.
Converted this to an issue: #2903