Skip to content

Conversation

@pyramation
Copy link
Collaborator

Summary

Removes hardcoded pg_catalog. prefix from the getPgCatalogTypeName function in the TypeScript deparser. This fixes issues with extension types (citext, hstore, ltree, etc.) that don't live in pg_catalog but in the schema where the extension is installed (typically public).

PostgreSQL automatically searches pg_catalog first via the implicit search_path, so explicit qualification is unnecessary for built-in types and incorrect for extension types.

Changes:

  • bpchar without size modifier: pg_catalog.bpcharbpchar
  • real type: pg_catalog.float4float4
  • Default/unknown types: pg_catalog.${typeName}typeName

Related issue: constructive-io/constructive-planning#477

Review & Testing Checklist for Human

  • Verify that downstream consumers of pgsql-deparser don't rely on the pg_catalog. prefix being present in deparsed output
  • Test deparsing a column with an extension type (e.g., citext) to confirm it no longer produces pg_catalog.citext
  • Run the full test suite to ensure no regressions in type name handling

Notes

This is a companion fix to constructive-db PR #179 which applies the same fix to the SQL deparser.

Link to Devin run: https://app.devin.ai/sessions/45dd8cf3c5c4475f974e0ba445857a70
Requested by: Dan Lynch (@pyramation)

- Remove 'pg_catalog.' prefix from getPgCatalogTypeName() default case
- Remove 'pg_catalog.bpchar' fallback, use just 'bpchar'
- Remove 'pg_catalog.float4' for real type, use just 'float4'

This fixes issues with extension types like citext, hstore, ltree, etc.
that don't live in pg_catalog but in the schema where the extension
is installed (typically public).

PostgreSQL automatically searches pg_catalog first via the implicit
search_path, so explicit qualification is unnecessary for built-in
types and incorrect for extension types.

Fixes: constructive-io/constructive-planning#477
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@pyramation pyramation merged commit ec3b608 into main Jan 1, 2026
14 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