On Tue, Jul 09, 2019 at 02:23:57PM +0200, Dmitry Dolgov wrote:
> > On Mon, Jul 8, 2019 at 6:46 AM Thomas Munro <[email protected]> wrote:
> >
> > On Fri, Jun 7, 2019 at 6:22 AM Dmitry Dolgov <[email protected]> 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/donate
diff --git a/src/tutorial/subscripting.c b/src/tutorial/subscripting.c
index 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);