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

Defer oid and typarray to stage when an extension is supported #649

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

chrischall
Copy link
Contributor

Addresses #631.

@mp911de
Copy link
Collaborator

mp911de commented Apr 15, 2024

Care to elaborate what this change achieves other than delaying the lookup?

@chrischall
Copy link
Contributor Author

chrischall commented Apr 16, 2024

Care to elaborate what this change achieves other than delaying the lookup?

Apologies. Our application connects to Redshift which is compatible with PostgreSQL 8.0.2. Unfortunately, that version does not have oid or typarray columns in the pg_catalog.pg_type table. There was already a fix to set the type to PostgresTypes.NO_SUCH_TYPE in the event the typarray column is missing. However, there was no similar fix for the missing oid column.

This fix handles that by only attempting to get the oid column if the BuiltinCodec is supported. For the POSTGIS_GEOMETRY codec, this relies on another library being on the classpath. So, for our application, we do not have that library on our classpath so it will not try to register that codec and will not try to get the oid column.

*edited to fix minor typo

@mp911de mp911de changed the title Only get oid and typarray when extension is supported. Defer oid and typarray to stage when an extension is supported Apr 18, 2024
@mp911de
Copy link
Collaborator

mp911de commented Apr 18, 2024

Thanks for the insight. I wasn't aware that oid could be missing as well.

@mp911de mp911de added the type: enhancement A general enhancement label Apr 18, 2024
@mp911de mp911de self-assigned this Apr 18, 2024
@reneleonhardt
Copy link

The richest corporation in the world had 14 years time to keep up with 14 new awesome Postgres versions since 2010... but they didn't want to? At least Amazon Aurora is current these days and saves a bit of the cost 😅
https://www.postgresql.org/about/news/postgresql-17-beta-1-released-2865/

Wouldn't ClickHouse be the modern choice if OLAP has to run on AWS? 🤔
https://clickhouse.com/blog/migrating-data-between-clickhouse-postgres
https://aws.amazon.com/solutions/implementations/clickhouse-cluster/

@mp911de mp911de merged commit 04c50f3 into pgjdbc:main Oct 2, 2024
mp911de pushed a commit that referenced this pull request Oct 2, 2024
@mp911de
Copy link
Collaborator

mp911de commented Oct 2, 2024

Thank you for your contribution. That's merged and backported now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not require oid column for unsupported extensions during auto-registeration
3 participants