Re: Thoughts on user-defined types for talk at Postgres conference? - Mailing list pgsql-general

From Tom Lane
Subject Re: Thoughts on user-defined types for talk at Postgres conference?
Date
Msg-id 453185.1709795540@sss.pgh.pa.us
Whole thread Raw
In response to Re: Thoughts on user-defined types for talk at Postgres conference?  (Stephen Frost <sfrost@snowman.net>)
List pgsql-general
Stephen Frost <sfrost@snowman.net> writes:
> * Guyren Howe (guyren@gmail.com) wrote:
>> It seems as though a Composite Type having only fixed-length fields should be able to be regarded as a fixed-length
value.

> While I can understand where you're coming from with that, it's
> certainly not something the system is built to handle today and, at
> least from my recent review of this area, looks like there would be a
> fair bit of code involved to get to that point.

There are some other fundamental problems here:

* To conclude that a tuple of only fixed-length column types is
itself fixed-length, you need an additional assumption that all
the columns are not-null.  This is pretty problematic because
we don't even have a way to enforce such a requirement against
generic composite types; we really only promise to enforce
column constraints against columns of physical tables.

* Even if all the semantic enforcement of that were bulletproof,
we'd still have a big problem with compatibility of the on-disk
representation between current releases and a future release
that thought it could elide some part of the tuple header for
all-not-null stored composite values.

I don't say that these problems are insoluble, but they do
look pretty difficult.

            regards, tom lane



pgsql-general by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Thoughts on user-defined types for talk at Postgres conference?
Next
From: Achilleas Mantzios - cloud
Date:
Subject: pl/pgsql outside the DB, (i.e. on the terminal) possible ?