Skip to content

fix(pg-catalog): restrict unqualified pg table rewrite#364

Merged
sunng87 merged 1 commit into
datafusion-contrib:masterfrom
discord9:fix/strict-pg-catalog-rewrite-upstream
Jun 25, 2026
Merged

fix(pg-catalog): restrict unqualified pg table rewrite#364
sunng87 merged 1 commit into
datafusion-contrib:masterfrom
discord9:fix/strict-pg-catalog-rewrite-upstream

Conversation

@discord9

Copy link
Copy Markdown
Contributor

Summary

  • Restrict PrependUnqualifiedPgTableName to known PG_CATALOG_TABLES instead of every unqualified pg_* name.
  • Preserve unqualified pg_catalog relation support such as pg_namespace and pg_type.
  • Add regression coverage so user tables like pg_compat_test are not rewritten to pg_catalog.

This keeps the PostgreSQL implicit pg_catalog search path compatibility while avoiding false positives for user-defined tables whose names start with pg_.

Related: GreptimeTeam/greptimedb#8359

Tests

  • cargo test --manifest-path datafusion-pg-catalog/Cargo.toml test_prepend_unqualified_table_name
  • cargo test --manifest-path datafusion-pg-catalog/Cargo.toml --lib

@sunng87

sunng87 commented Jun 25, 2026

Copy link
Copy Markdown
Member

Looks good!

@sunng87 sunng87 merged commit 7bf54cb into datafusion-contrib:master Jun 25, 2026
7 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.

2 participants