Re: A Generic Question about Generic type subscripting - Mailing list pgsql-hackers

From Tom Lane
Subject Re: A Generic Question about Generic type subscripting
Date
Msg-id 2024.1517240549@sss.pgh.pa.us
Whole thread Raw
In response to A Generic Question about Generic type subscripting  (Hannu Krosing <hannu.krosing@2ndquadrant.com>)
List pgsql-hackers
Hannu Krosing <hannu.krosing@2ndquadrant.com> writes:
> I started looking at the thread about "Generic type subscripting" and am
> wondering, why does it take the approach of modifying pg_type and
> modifying lots of internal functions, when instead it could be defined
> in a much lighter and less intrusive way as an operator, probably by
> reserving a dedicated operator name

It's pretty hard to see how that would extend to allowing extensions to
support either array slices ("arr[lo:hi]") or multi-dimensional arrays.
Or at least, by the time you get done with allowing those cases, plus
assignments to them, it's not so lightweight anymore.

You could make the argument that it's okay to blow all those options off
and say that extension types only get to define the simplest form of
one-subscript subscripting.  But this patch has higher ambition than
that, and I think that's good.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Built-in connection pooling
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] MERGE SQL Statement for PG11