Skip to content

Improve pg_catalog type mapping#305

Open
mjgarton wants to merge 2 commits intodatafusion-contrib:masterfrom
mjgarton:improve_pg_catalog_type_mapping
Open

Improve pg_catalog type mapping#305
mjgarton wants to merge 2 commits intodatafusion-contrib:masterfrom
mjgarton:improve_pg_catalog_type_mapping

Conversation

@mjgarton
Copy link
Collaborator

@mjgarton mjgarton commented Mar 9, 2026

Instead of PgAttributeTable deciding how to map from arrow types to postgres types, delegate that decision to arrow-pg. This avoids duplicationm, brings consistency, and makes us more robust against future changes and additions to the mapping in arrow-pg.

Instead of PgAttributeTable deciding how to map from arrow types to
postgres types, delegate that decision to arrow-pg.  This avoids
duplicationm, brings consistency, and makes us more robust against
future changes and additions to the mapping in arrow-pg.
@mjgarton
Copy link
Collaborator Author

mjgarton commented Mar 9, 2026

I haven't tested this much yet, but from a quick try it fixes the issue I was seeing and seems okay so far.

@sunng87 sunng87 self-requested a review March 10, 2026 01:54
Field::new("attrelid", DataType::Int32, false), // OID of the relation this column belongs to
Field::new("attname", DataType::Utf8, false), // Column name
Field::new("atttypid", DataType::Int32, false), // OID of the column data type
Field::new("atttypid", DataType::UInt32, false), // OID of the column data type
Copy link
Member

Choose a reason for hiding this comment

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

Can we keep this as int32? Because there is no native unsigned integer in postgres, using uint32 may introduces issues when we want to use this field with other UDFs.

Revert back to signed ints for iod since postgresql does not have
support for unsigned ints.
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