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

Enforcing array type structure #1765

Open
workingjubilee opened this issue Jul 8, 2024 · 0 comments
Open

Enforcing array type structure #1765

workingjubilee opened this issue Jul 8, 2024 · 0 comments

Comments

@workingjubilee
Copy link
Member

Some datatypes in Postgres are inductive types. Notably, rows/composite types are: a composite types is made up of a selection of fields of other types, including, potentially, a composite type! However, arrays are not an inductive datatype in Postgres. There is no representation for "array of array of T" that is sensical: there are only arrays of higher dimensionality. And an array must form a matrix, see #1762 for more on that.

...however, you can make an array that is made of composite types, and you can make a composite type that has an array as a field, making the fact it isn't implemented as a potentially-inductive datatype... rather pointless?

Whatever, I don't really care.

...Except I do care that I get reports of people trying to return Vec<Vec<T>>, but that doesn't have a coherent repr in Postgres, so they get something they didn't expect. If we made it so this didn't work unless it was something an array considered a valid type, this would fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant