Skip to content

Enforcing array type structure #1765

Description

@workingjubilee

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions