exyi / pg2parquet

Export PostgreSQL table or query into Parquet file
Apache License 2.0
57 stars 11 forks source link

Add support for Postgres TLS connections. #2

Closed kurtraschke closed 1 year ago

kurtraschke commented 1 year ago

This PR adds support for TLS connections using the postgres-native-tls crate.

exyi commented 1 year ago

Hi, thanks for the patch! Don't worry about the GA too much :sweat_smile: (especially weird architectures), I can have a look at this and try to fix it. Since the arm64 stuff is cross compiled on amd64, getting openssl there might be quite non-trivial, I'd say we can just omit TLS support on non-x86 architectures for now (as I did with jemallocator). Another option to try would be the rust implementation of TLS, but I have no experience with that, so I have no idea if it will solve more problems than bring :]

kurtraschke commented 1 year ago

I nuked this for now so I could tinker with the configuration a bit more without dumping a bunch of intermediate commits in the PR (though I'd have squashed in the end anyway). In the present state, I do have it building on arm64 with cross, and in theory the same approach should work for riscv64 but there isn't a Debian riscv64 package of libssl-dev (which I suppose is not surprising?). musl support also seems to be a lost cause, at least with the present build setup - although there are Docker containers out there that claim to be able to build Rust packages under musl with a statically compiled OpenSSL included.

All that to say the upshot is that this should work for native Linux builds on any architecture where OpenSSL is available, as well as on Windows and macOS (where other system-level TLS facilities are used). If you are interested in cleaning up the rough edges, I'll squash my current working branch and reopen.