Re: A Generic Question about Generic type subscripting

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hannu Krosing <hannu(dot)krosing(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: A Generic Question about Generic type subscripting
Date: 2018-01-29 15:42:29
Message-ID: 2024.1517240549@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hannu Krosing <hannu(dot)krosing(at)2ndquadrant(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2018-01-29 15:44:57 Re: [HACKERS] MERGE SQL Statement for PG11
Previous Message Bruce Momjian 2018-01-29 15:34:02 Re: Built-in connection pooling