apache / apache/arrow-adbc

c/driver/postgresql: support Materialize

Open
#3,690 5 comments 1 reaction 0 assignees View on GitHub
Type: enhancement
Dominant language
C#
Stars
627
Forks
217
Avg merge
17h
Merged PRs (30d)
57

Description

### What feature or improvement would you like to see?

[Materialize](https://materialize.com) claims to be wire-compatible with PostgreSQL, but I cannot successfully connect to Materialize with the PostgreSQL ADBC driver, because in Materialize, `pg_catalog.pg_type` lacks a `typsend` column, so [this query](https://github.com/apache/arrow-adbc/blob/ef8c485892448350413190639e739679c732cb18/c/driver/postgresql/database.cc#L275-L278) fails.

Steps to repro:
```sh
docker run -d -p 127.0.0.1:6874:6874 -p 127.0.0.1:6875:6875 -p 127.0.0.1:6876:6876 -p 127.0.0.1:6877:6877 materialize/materialized
```
```py
from adbc_driver_manager import dbapi

con = dbapi.connect(
driver="postgresql",
db_kwargs={
"uri": "postgresql://materialize@localhost:6875/materialize"
}
)
```
This prints the error:
```
Traceback (most recent call last):
File "/path/to/main.py", line 22, in
con = dbapi.connect(
driver="postgresql",
...<2 lines>...
}
)
File "/path/to/.cache/uv/environments-v2/main-f5af4a4134451b7b/lib/python3.13/site-packages/adbc_driver_manager/dbapi.py", line 227, in connect
db = _lib.AdbcDatabase(**db_kwargs)
File "adbc_driver_manager/_lib.pyx", line 582, in adbc_driver_manager._lib.AdbcDatabase.__init__
File "adbc_driver_manager/_lib.pyx", line 261, in adbc_driver_manager._lib.check_error
adbc_driver_manager.ProgrammingError: INVALID_ARGUMENT: [libpq] Failed to execute query 'SELECT oid, typname, typreceive, typbasetype, typrelid, typarray FROM pg_catalog.pg_type WHERE (typreceive != 0 OR typsend != 0) AND typtype != 'r' AND typreceive::TEXT != 'array_recv'': ERROR: WHERE clause error: column "typsend" does not exist
. SQLSTATE: XX000
```

This was the first error that occurred, but there might be other errors once we get past this one.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.