alexander-beedie opened a new issue, #1109:
URL: https://github.com/apache/arrow-adbc/issues/1109

   PostgreSQL driver/backend doesn't honour the value of `db_schema_name`.
   Ingest now only seems to write into the "public" schema.
   
   ## Example
   ```python
   from adbc_driver_postgresql.dbapi import connect
   import pyarrow as pa
   
   test_data = pa.Table.from_pydict({
       "key": ["aa", "bb", "cc"], 
       "value": [10, 20, 30], 
   })
   
   # adjust URI as needed (I have a test instance in a local container)
   uri = "postgresql://postgres@localhost:5432/postgres"
   
   # schema into which the test data/table will be written
   target_schema = "demo_schema"
   target_table  = "tbl_test_data"
   create_schema = f"CREATE SCHEMA IF NOT EXISTS {target_schema}"
   drop_target   = f"DROP TABLE IF EXISTS {target_table}"
   
   # ingest, setting the target db schema name
   with connect(uri) as conn, conn.cursor() as cursor:
       cursor.execute(create_schema)
       cursor.execute(create_schema)
       
       cursor.adbc_ingest(
           target_table,
           test_data,
           "create",
           db_schema_name=target_schema,
       )
       conn.commit()
   ```
   ## Result
   * Table written to "public" schema; "demo_schema" is empty.
   
     <img width="235" alt="Screenshot 2023-09-27 at 00 02 46" 
src="https://github.com/apache/arrow-adbc/assets/2613171/ad45dd59-47ae-465f-84d5-dcb130716ed9";>
   
   
   
   
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to