pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Allow subscripting of hstore values.
Date: Fri, 11 Dec 2020 23:58:39 +0000
Message-ID: <E1knsJ5-0005OB-56@gemulon.postgresql.org> (raw)

Allow subscripting of hstore values.

This is basically a finger exercise to prove that it's possible for
an extension module to add subscripting ability.  Subscripted fetch
from an hstore is not different from the existing "hstore -> text"
operator.  Subscripted update does seem to be a little easier to
use than the traditional update method using hstore concatenation,
but it's not a fundamentally new ability.

However, there may be some value in the code as sample code, since
it shows what's basically the minimum-complexity way to implement
subscripting when one needn't consider nested container objects.

Discussion: https://postgr.es/m/3724341.1607551174@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0ec5f7e78231a621a1d96c4bfedc4a1849a6c6cc

Modified Files
--------------
contrib/hstore/Makefile             |   4 +-
contrib/hstore/expected/hstore.out  |  23 +++
contrib/hstore/hstore--1.7--1.8.sql |  13 ++
contrib/hstore/hstore.control       |   2 +-
contrib/hstore/hstore_subs.c        | 297 ++++++++++++++++++++++++++++++++++++
contrib/hstore/sql/hstore.sql       |   8 +
doc/src/sgml/hstore.sgml            |  42 +++++
doc/src/sgml/ref/create_type.sgml   |   8 +-
8 files changed, 392 insertions(+), 5 deletions(-)



Message-ID: <E1knsJ5-0005OB-56@gemulon.postgresql.org>
Permalink:  ../E1knsJ5-0005OB-56@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1knsJ5-0005OB-56@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Allow subscripting of hstore values.
  In-Reply-To: <E1knsJ5-0005OB-56@gemulon.postgresql.org>
  References: <E1knsJ5-0005OB-56@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox