You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will connect without authentication or encryption, to a Flight SQL service running on localhost on port 12345. Each request will also include a database=mydb gRPC header.
So just appending &x-flight-sql-database=... should work
It doesn't work, I am also connected with Postgres JDBC provider on port 5432 and that works ccrrectly. I tried also useEncryption=1. The following jdbc connection string works
I figured it out reading carefully the logs that there was a previous problem that was hiding the real problem.
postgres-1 |
postgres-1 | 2024-09-01 21:32:09.143 UTC [1] LOG: starting PostgreSQL 15.7 (Debian 15.7-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
postgres-1 | 2024-09-01 21:32:09.145 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
postgres-1 | 2024-09-01 21:32:09.145 UTC [1] LOG: listening on IPv6 address "::", port 5432
postgres-1 | 2024-09-01 21:32:09.146 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres-1 | 2024-09-01 21:32:09.153 UTC [76] LOG: database system was shut down at 2024-09-01 21:32:08 UTC
postgres-1 | 2024-09-01 21:32:09.170 UTC [1] LOG: database system is ready to accept connections
postgres-1 | 2024-09-01 21:32:09.210 UTC [81] LOG: listening on grpc://127.0.0.1:15432 for Apache Arrow Flight SQL
postgres-1 | 2024-09-01 21:37:09.256 UTC [74] LOG: checkpoint starting: time
I realized that the arrow-flight was only binding on 127.0.0.1 and my docker-compose was not mapping that, I discovered that via grpccurl. It might be a good idea to align the arrow-flight-sql binding behavior to the one of the "traditional" connector.
However, this didn't solve the problem, I created a small snippet
telnet localhost 15432
Trying ::1...
Connection failed: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
???@Did not receive HTTP/2 settings before handshake timeoutConnection closed by foreign host.
Container from the outside container
telnet 127.0.0.1 15432
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.
Sure, the table is minimal I was really only trying to get the connector to work
CREATETABLEpeople (
phone_number VARCHAR(255)
);
INSERT INTO people (phone_number) VALUES ('123-45-6789');
INSERT INTO people (phone_number) VALUES ('987-65-4321');
INSERT INTO people (phone_number) VALUES ('555-55-5555');
OK. Could you change the last host all all all scram-sha-256 line in /var/lib/postgresql/data/pg_hba.conf to host all all all plain?
Apache Arrow Flight SQL adapter for PostgreSQL doesn't support scran-sha-256 yet because it's a challenge-response type authentication.
Is there any intention to add md5 and scram-sha-256 compatibility for this extension in the near future? I'm getting a sense that FlightSQL hasn't really taken off yet (pun intended).
It's difficult to support md5 and scram-sha-256 because they are challenge-response based authentications. There is no standard way to implement challenge-response based authentications in Flight SQL.
Could you use TLS + password for secure authentication?
Thank you. I thought that's how you'd respond based on your above responses, but I saw the // TODO comments in your code so I thought I'd ask. Generally speaking, over the Postgres wire is perfectly performant for my use cases, but I'm exploring FlightSQL for a future project and using it with Postgres is a good start. Thank you for creating this.
Activity
kou commentedon Sep 4, 2024
Could you try
jdbc:arrow-flight-sql://localhost:15432/?username=${USER_NAME}&password=${PASSWORD}&useEncryption=1?@lidavidm Can we specify
x-flight-sql-databaseheader with the JDBC driver?lidavidm commentedon Sep 4, 2024
https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html#connecting-to-a-database
So just appending
&x-flight-sql-database=...should workedmondop commentedon Sep 4, 2024
I tried with the followng
It doesn't work, I am also connected with Postgres JDBC provider on port 5432 and that works ccrrectly. I tried also useEncryption=1. The following jdbc connection string works
kou commentedon Sep 5, 2024
Could you try
jdbc:arrow-flight-sql://localhost:15432/?username=postgres&password=mypassword&useEncryption=0&x-flight-sql-database=mydb?edmondop commentedon Sep 5, 2024
I figured it out reading carefully the logs that there was a previous problem that was hiding the real problem.
I realized that the arrow-flight was only binding on 127.0.0.1 and my docker-compose was not mapping that, I discovered that via grpccurl. It might be a good idea to align the arrow-flight-sql binding behavior to the one of the "traditional" connector.
However, this didn't solve the problem, I created a small snippet
this fails like so:
If I enable useEncryption=1, it fails during TSL negotiation.
kou commentedon Sep 6, 2024
Could you share PostgreSQL log on the error?
edmondop commentedon Sep 6, 2024
Is there a different log for arrow ? The console doesn't show anything
kou commentedon Sep 6, 2024
arrow-flight-sql-postgresql uses the same log as PostgreSQL's one.
Hmm. Could you share your
public.peopledefinition?lidavidm commentedon Sep 6, 2024
Isn't the URI in the code snippet still using
&database=and not&x-flight-sql-database=?edmondop commentedon Sep 6, 2024
I have some additional interesting infos.
Connecting from within the container works:
Container from the outside container
edmondop commentedon Sep 6, 2024
I tried that, doesn't make a difference. It looks like a problem with networking. I need to figure out why
kou commentedon Sep 6, 2024
Could you provide your
docker-compose.yml?edmondop commentedon Sep 8, 2024
kou commentedon Sep 8, 2024
Thanks.
Could you also provide
init.sql?edmondop commentedon Sep 9, 2024
Sure, the table is minimal I was really only trying to get the connector to work
kou commentedon Sep 12, 2024
Thanks.
I found a problem in "ghcr.io/apache/arrow-flight-sql-postgresql:main-bookworm-15": #191
Could you try again after
docker compose pullto use the latest image?edmondop commentedon Sep 12, 2024
Thank you, now I get a connection error
UNAUTHENTICATED: Invalid: SCRAM auth method isn't supported yet. Detail: Unauthenticatedif i use enableEncryption=0, if I use enableEncryption=1 instead I get an SSL Exception
kou commentedon Sep 13, 2024
OK. Could you change the last
host all all all scram-sha-256line in/var/lib/postgresql/data/pg_hba.conftohost all all all plain?Apache Arrow Flight SQL adapter for PostgreSQL doesn't support
scran-sha-256yet because it's a challenge-response type authentication.edmondop commentedon Sep 13, 2024
Thanks, this is not something I can disable at client level right?
kou commentedon Sep 13, 2024
Right.
It's a server side configuration.
edmondop commentedon Jul 10, 2025
Bumping this @kou , do you think we should change the docker image to automatically disable SCRAM auth?
kou commentedon Jul 11, 2025
No. It seems that we can change it by the
POSTGRES_HOST_AUTH_METHODenvironment variable: https://hub.docker.com/_/postgres#postgres_host_auth_methodCould you try it?
CincyBC commentedon Sep 17, 2025
Is there any intention to add
md5andscram-sha-256compatibility for this extension in the near future? I'm getting a sense that FlightSQL hasn't really taken off yet (pun intended).kou commentedon Sep 17, 2025
It's difficult to support
md5andscram-sha-256because they are challenge-response based authentications. There is no standard way to implement challenge-response based authentications in Flight SQL.Could you use TLS +
passwordfor secure authentication?CincyBC commentedon Sep 18, 2025
Thank you. I thought that's how you'd respond based on your above responses, but I saw the
// TODOcomments in your code so I thought I'd ask. Generally speaking, over the Postgres wire is perfectly performant for my use cases, but I'm exploring FlightSQL for a future project and using it with Postgres is a good start. Thank you for creating this.kou commentedon Sep 18, 2025
Thanks.
I should release a new version that supports the latest Flight SQL specification and the latest PostgreSQL...