Skip to content

Enable a pgcompat mode for alternative PG compatible engines #490

Description

@khepin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions