From: David Fetter <david@fetter.org>
To: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Oleksandr Shulgin <oleksandr.shulgin@zalando.de>
Cc: Artur Zakirov <a.zakirov@postgrespro.ru>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: Oleg Bartunov <obartunov@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: David Steele <david@pgmasters.net>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] [PATCH] Generic type subscripting
Date: Thu, 11 Jul 2019 09:47:24 +0200
Message-ID: <20190711074723.GK24679@fetter.org> (raw)
In-Reply-To: <CA+q6zcV3bzfSRfWu4pFich46evryijX3ELFV_zm=kPg7KALaOQ@mail.gmail.com>
References: <CA+q6zcX=MiLjQhaX-L=iFFj1oR_eLXowK7_SRQ=u=Dd7mCjz-g@mail.gmail.com>
<CA+q6zcXFUcfLJwx6w+Hg-XzifRa0zzBozAfXg6+Y1dHY_xZ5EA@mail.gmail.com>
<CA+q6zcXnesTL5ALJ+_M6gmP+7ehBL9eMJqy25hhD3Gx44AOCpw@mail.gmail.com>
<CA+q6zcWtU3Vopo3xbmyVazQBjhqj5CfAy7MTEuwmi46s2fq5AA@mail.gmail.com>
<CAFj8pRBhHabV06m_-n6qjmR-BQC=+t740EJs4Gu5Ck0jzNQMhQ@mail.gmail.com>
<CA+q6zcW+n0q7NVvYi2rHxcME2OXnL4V7zQRLvKkiETGB8Nxvag@mail.gmail.com>
<CA+q6zcU=CiNNo45m40sSGRLa6AGEuBUdEiqN8NUyA+A5QYFXbg@mail.gmail.com>
<CA+q6zcU0wS3edY2b+dQMU4qwBiQ=6-x_mwDRAp5U-a6NvHj0cA@mail.gmail.com>
<CA+hUKGKj6sSu7+a_u4S7uHV_4aFiN5Es+mz1jn0nYFZErX71qA@mail.gmail.com>
<CA+q6zcV3bzfSRfWu4pFich46evryijX3ELFV_zm=kPg7KALaOQ@mail.gmail.com>
On Tue, Jul 09, 2019 at 02:23:57PM +0200, Dmitry Dolgov wrote:
> > On Mon, Jul 8, 2019 at 6:46 AM Thomas Munro <thomas.munro@gmail.com> wrote:
> >
> > On Fri, Jun 7, 2019 at 6:22 AM Dmitry Dolgov <9erthalion6@gmail.com> wrote:
> > > > > >> Rebase after pg_indent. Besides, off the list there was a suggestion that this
> > > > > >> could be useful to accept more than one data type as a key for subscripting.
> > > > > >> E.g. for jsonb it probably makes sense to understand both a simple key name and
> > > > > >> jsonpath:
> > > >
> > > > And one more rebase.
> > >
> > > Oh, looks like I was just confused and it wasn't necessary - for some reason
> > > starting from v22 cfbot tries to apply v6 instead of the latest one.
> >
> > Hi Dmitry,
> >
> > Sorry about that. It looks like I broke the cfbot code that picks
> > which thread to pull patches from when there are several registered in
> > the CF app, the last time the HTML format changed. Now it's back to
> > picking whichever thread has the most recent message on it. Such are
> > the joys of web scraping (obviously we need better integration and
> > that will happen, I just haven't had time yet).
> >
> > Anyway, I fixed that. But now you really do need to rebase :-)
>
> Thanks for fixing and for the reminder! Here is the new rebased version. It
> contradicts a bit with 44982e7d09, because I'm actually using indexprSlice, but
> I guess we can figure this out.
>
> And I must admit, it's a pure fun to maintain such a large patch set in sync
> for already several years :)
Looks great!
The tutorial piece has bit-rotted slightly. Please find attached a
patch atop yours that fixes it.
Best,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donateAttachments:
[text/x-diff] fix_subscripting_tutorial.patch (897B, ../20190711074723.GK24679@fetter.org/2-fix_subscripting_tutorial.patch)
download | inline diff:diff --git a/src/tutorial/subscripting.c b/src/tutorial/subscripting.cindex c1ff66d299..9f64e3f2bd 100644--- a/src/tutorial/subscripting.c+++ b/src/tutorial/subscripting.c@@ -170,7 +170,7 @@ custom_subscript_fetch(Datum containerSource, SubscriptingRefState *sbstate)
if (sbstate->numupper != 1)
ereport(ERROR, (errmsg("custom does not support nested subscripting")));
- index = DatumGetInt32(sbstate->upper[0]);+ index = DatumGetInt32(sbstate->numupper);
if (index == 1)
return (Datum) container->first;
@@ -190,7 +190,7 @@ custom_subscript_assign(Datum containerSource, SubscriptingRefState *sbstate)
if (sbstate->numupper != 1)
ereport(ERROR, (errmsg("custom does not support nested subscripting")));
- index = DatumGetInt32(sbstate->upper[0]);+ index = DatumGetInt32(sbstate->numupper);
if (index == 1)
container->first = DatumGetInt32(sbstate->replacevalue);
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: david@fetter.org, 9erthalion6@gmail.com, thomas.munro@gmail.com, pavel.stehule@gmail.com, alvherre@2ndquadrant.com, thomas.munro@enterprisedb.com, oleksandr.shulgin@zalando.de, a.zakirov@postgrespro.ru, tgl@sss.pgh.pa.us, robertmhaas@gmail.com, andres@anarazel.de, michael.paquier@gmail.com, obartunov@gmail.com, peter.eisentraut@2ndquadrant.com, david@pgmasters.net
Subject: Re: [HACKERS] [PATCH] Generic type subscripting
In-Reply-To: <20190711074723.GK24679@fetter.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