Was recently working on trying to get ducklake working on top of Spanner via https://docs.cloud.google.com/spanner/docs/pgadapter and hit an issue where the ATTACH introspection ends up breaking this particular path.
In this case, the issue comes from ATTACH looking at pg_class, pg_attribute, .... Some of the PG compatible databases are "wire compatible" but not necessarily compatible on all such internals.
I've found #373 that points to a similar problem but fortunately for them had an easy resolution.
pgcompat
Instead of building a completely separate extension I was thinking this code could register 2 extensions:
config.storage_extensions["postgres"] = make_uniq<PostgresStorageExtension>();
config.storage_extensions["pgcompat"] = make_uniq<PostgresStorageExtension>(/*compat=*/true);
Where pgcompat would:
- query
information_schema instead of pg_catalog
- set
pg_use_ctid_scan=false (spanner / cockroach unsupported)
- set
pg_use_binary_copy=false
- set
pg_use_text_protocol=true
or additional param
Alternatively, since some of those can already be configured on the connection via
SET pg_use_text_protocol = true;
This could just be 1 additional param like
SET pg_use_information_schema_introspection = true;
I'm happy to look into making a PR for either option or refine the options if this is something that makes sense for the extension.
Was recently working on trying to get ducklake working on top of Spanner via https://docs.cloud.google.com/spanner/docs/pgadapter and hit an issue where the
ATTACHintrospection ends up breaking this particular path.In this case, the issue comes from
ATTACHlooking atpg_class, pg_attribute, .... Some of the PG compatible databases are "wire compatible" but not necessarily compatible on all such internals.I've found #373 that points to a similar problem but fortunately for them had an easy resolution.
pgcompat
Instead of building a completely separate extension I was thinking this code could register 2 extensions:
Where
pgcompatwould:information_schemainstead ofpg_catalogpg_use_ctid_scan=false(spanner / cockroach unsupported)pg_use_binary_copy=falsepg_use_text_protocol=trueor additional param
Alternatively, since some of those can already be configured on the connection via
This could just be 1 additional param like
I'm happy to look into making a PR for either option or refine the options if this is something that makes sense for the extension.