postgres_scanner icon indicating copy to clipboard operation
postgres_scanner copied to clipboard

Request: make compatible with Clickhouse postgres interface

Open alanpaulkwan opened this issue 1 year ago • 2 comments

What happens?

I've mentioned over Discord but would be great.

postgres_attach('host=localhost port=9005 dbname=default connect_timeout=10 user=default password=donthackmeplease');

Error: IO Error: Unable to query Postgres: ERROR: Query execution failed. DB::Exception: Table default.pg_class doesn't exist server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.

To Reproduce

Run a clickhouse server, which defaults postgres on port 9005. Password (made up) is donthackmeplease

Then run the postgres attach command

OS:

ubuntu

PostgreSQL Version:

Clickhouse

DuckDB Version:

7

DuckDB Client:

cli

Full Name:

Alan Kwan

Affiliation:

HKU

Have you tried this on the latest master branch?

  • [X] I agree

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • [X] I agree

alanpaulkwan avatar Mar 05 '23 07:03 alanpaulkwan

pg_class is a fairly fundamental metadata table in Postgres. Maybe click house can simulate its existence?

hannes avatar Mar 06 '23 08:03 hannes

Interesting, I thought about this but hesitated in case there were other metadata down the line to generate.

If it's just this table, I'll give it a shot - and post a solution here if I find one.

alanpaulkwan avatar Mar 06 '23 09:03 alanpaulkwan