Re: [HACKERS] [PATCH] Generic type subscripting

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Alexander Korotkov <aekorotkov(at)gmail(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, David Steele <david(at)pgmasters(dot)net>, Nikita Glukhov <n(dot)gluhov(at)postgrespro(dot)ru>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, David Fetter <david(at)fetter(dot)org>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Oleksandr Shulgin <oleksandr(dot)shulgin(at)zalando(dot)de>, Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Oleg Bartunov <obartunov(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] [PATCH] Generic type subscripting
Date: 2020-12-09 21:59:34
Message-ID: 3724341.1607551174@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Here's a couple of little finger exercises to move this along a bit.

0001 adds the ability to attach a subscript handler to an existing
data type with ALTER TYPE. This is clearly going to be necessary
if we want extension types to be able to use this facility. The
only thing that I think might be controversial here is that I did
not add the ability to set pg_type.typelem. While that'd be easy
enough so far as ALTER TYPE is concerned, I'm not sure that we want
to encourage people to change it. The dependency rules mean that
the semantics of typelem aren't something you really want to change
after-the-fact on an existing type. Also, if we did allow it, any
existing SubscriptingRef.refelemtype values in stored views would
fail to be updated.

0002 makes use of that to support subscripting of hstore. I'm not
sure how much we care about that from a functionality standpoint,
but it seems like it might be good to have a contrib module testing
that extensions can use this. Also, I thought possibly an example
showing what's basically the minimum possible amount of complexity
would be good to have. If people like this, I'll finish it up (it
lacks docs) and add it.

regards, tom lane

Attachment Content-Type Size
0001-add-alter-type-subscript-option.patch text/x-diff 8.6 KB
0002-allow-hstore-subscripting.patch text/x-diff 12.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2020-12-09 22:18:37 Re: Proposed patch for key managment
Previous Message chenhj 2020-12-09 21:44:18 Re: [Proposal] Page Compression for OLTP