pgx-managed Postgres w/ wrappers behaved differently from locally-installed Postgres w/ wrappers #26635
Unanswered
dventimihasura
asked this question in
Feature Requests
Replies: 0 comments 1 reply
|
Here's a reproducible demo. All you have to do is run |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I'm trying to use the
clickhouse_fdwwrapper and am hitting a snag. With correlated sub-query queries, I get an error and a different plan with wrappers installed into my local PostgreSQL. It works without error with wrappers installed in a pgx-managed PostgreSQL. Let me explain.I have Clickhouse running locally, with related tables
accountandorderand views on those tables. I have PostgreSQL scripts that set up a foreign server from PostgreSQL to Clickhouse running locally, and foreign tables set up on the views for theaccountandordertable. The views are involved to work around theclickhouse_fdwnot yet supportingUUIDfields, but don't dwell on that fact. I'm pretty sure that's unimportant and focusing on it would be a red herring.Anyway, the query I'm trying to run in PostgreSQL against the foreign tables looks like this.
It's a simple query with a sub-query in the
whereclause to pick out a randomaccountentry but beyond that it's not even a bona-fide correlated sub-query because the sub-query doesn't make reference to any tables in the enclosing query.If I start a pgx-managed PostgreSQL instance with the
clickhouse_fdwwith this command in thewrappers/wrappersdirectoryand run that query above, it works fine. If I install the
clickhouse_fdwextension in my local PostgreSQL instance with this commandI get this error with that same query listed above.
ERROR: query failed: Server error: `ERROR DB::Exception (386): DB::Exception: There is no supertype for types String, UInt8 because some of them are String/FixedString and some of them are not: while executing 'FUNCTION equals(id : 0, 0 : 4) -> equals(id, 0) UInt8 : 5'` DETAIL: WrappersThe query plans are different as well. The working version in the pgx-managed instance yields this plan:
The non-working version in the locally-installed instance yields this plan:
What the heck is going on here? Any ideas? For the record, both instances of PostgreSQL (my local one and the pgx-managed one) are v14.7.
P.S. I can work up some kind of reproducible demo or at least a screencast, but I figured I'd get the basic question out there first.
All reactions