Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add array type for PostgreSQL converter #410

Merged
merged 1 commit into from
Dec 20, 2023
Merged

Add array type for PostgreSQL converter #410

merged 1 commit into from
Dec 20, 2023

Conversation

criccomini
Copy link
Contributor

Recap's PostgreSQL converter now supports ARRAY column types. The implementation uses UDT_NAME in information_schema.columns to get the type of the array elements.

There are some weird behaviors with the implementation because of the way PostgreSQL handles arrays. Importantly, the element size is ignored (int(4)[] is just treated as int[]). PostgreSQL also treats all arrays as having an arbitrary number of dimensions, so int[] is the same as int[][], and so on.

See #264 for more discussion on the nuances of this implementation.

Closes #264

Copy link
Contributor

@alexdemeo alexdemeo left a comment

Choose a reason for hiding this comment

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

Looks great, thanks Chris!

@criccomini criccomini force-pushed the add-pg-arrays branch 2 times, most recently from 97245ca to 7100d3d Compare December 20, 2023 20:10
Recap's PostgreSQL converter now supports ARRAY column types. The
implementation uses `UDT_NAME` in `information_schema.columns` to get the type
of the array elements.

There are some weird behaviors with the implementation because of the way
PostgreSQL handles arrays. Importantly, the element size is ignored (int(4)[]
is just treated as int[]). PostgreSQL also treats all arrays as having an
arbitrary number of dimensions, so int[] is the same as int[][], and so on.

See #264 for more discussion on the
nuances of this implementation.

Closes #264
@criccomini criccomini merged commit 0cf154a into main Dec 20, 2023
3 checks passed
@criccomini criccomini deleted the add-pg-arrays branch December 20, 2023 20:27
criccomini pushed a commit that referenced this pull request Jan 3, 2024
Add array support to postgres reader/converter with dimensionality read
from `pg_attribute.attndims`. This is grabbed by joining on
`information_schema.columns.column_name = pg_attribute.attname`

This a followup to #410 which
lays a tiny bit of groundwork for
#264 (comment)
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.

Add ARRAY support to PostgresqlReader
2 participants