r2dbc-postgresql icon indicating copy to clipboard operation
r2dbc-postgresql copied to clipboard

Defer oid and typarray to stage when an extension is supported

Open chrischall opened this issue 1 year ago • 4 comments
trafficstars

Addresses #631.

chrischall avatar Apr 10 '24 17:04 chrischall

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

mp911de avatar Apr 15 '24 13:04 mp911de

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

chrischall avatar Apr 16 '24 15:04 chrischall

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

mp911de avatar Apr 18 '24 09:04 mp911de

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/

reneleonhardt avatar May 26 '24 14:05 reneleonhardt

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

mp911de avatar Oct 02 '24 08:10 mp911de