Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle DBeaver's pg_namespace query casting to REGCLASS #42

Merged
merged 3 commits into from
Dec 6, 2024

Conversation

ediril
Copy link
Contributor

@ediril ediril commented Dec 4, 2024

Fixes: #29

DBeaver sends the following sql to get info regarding tables:

"SELECT n.oid, n.*, d.description 
FROM pg_catalog.pg_namespace AS n 
LEFT OUTER JOIN pg_catalog.pg_description AS d 
ON d.objoid = n.oid AND d.objsubid = 0 AND d.classoid = CAST('pg_namespace' AS REGCLASS) ORDER BY nspname"

DuckDB does not have a REGCLASS data type though, so it fails. This PR modifies the incoming sql to make it work on duckdb, by removing the cast to REGCLASS.

@ediril ediril changed the title Dbeaver regclass Handle DBeaver's pg_namespace query casting to REGCLASS Dec 4, 2024
@ediril ediril marked this pull request as draft December 5, 2024 02:47
@ediril ediril marked this pull request as ready for review December 5, 2024 03:32
@ediril
Copy link
Contributor Author

ediril commented Dec 5, 2024

While this change makes the query work, it returns 3 mains because of duckdb's internal organization.

@jwills
Copy link
Owner

jwills commented Dec 6, 2024

@ediril yeah going back and forth on the 3 mains thing-- that is technically how DuckDB works, right? So that's probably okay to do?

@jwills jwills merged commit 363eee4 into jwills:main Dec 6, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Database connection error in dbeaver
2 participants