Skip to content

pg_attribute: report timestamptz and array columns by their type, not as text - #423

Merged
sunng87 merged 1 commit into
datafusion-contrib:masterfrom
naude-r:fix/support-timestamptz-and-array-cols-by-type
Sep 17, 2026
Merged

sunng87 merged 1 commit into
datafusion-contrib:masterfrom
naude-r:fix/support-timestamptz-and-array-cols-by-type

Conversation

@naude-r

@naude-r naude-r commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

PgAttributeTable::datafusion_to_pg_type handles only some of the types arrow_pg::datatypes::into_pg_type can return,
and everything else falls through to _ => TEXT. So a tz-aware timestamp column gets pg_attribute.atttypid 25, while
SELECT on the same column describes it as 1184, and \d shows text.

Clients that read column types from the catalog then see a different type from the one they get back when they
query the column. The same thing happens to the int4[]/text[] columns in the catalog's own tables. The values for
each new line are copied from PostgreSQL's pg_type rows.

…s arrow_pg::datatypes::into_pg_type can return,

and everything else falls through to _ => TEXT. So a tz-aware timestamp column gets pg_attribute.atttypid 25, while
SELECT on the same column describes it as 1184, and \d shows text.

Clients that read column types from the catalog then see a different type from the one they get back when they
query the column. The same thing happens to the int4[]/text[] columns in the catalog's own tables. The values for
each new line are copied from PostgreSQL's pg_type rows.

@sunng87 sunng87 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@naude-r Thank you!

@sunng87
sunng87 merged commit b2c735c into datafusion-contrib:master Sep 17, 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