pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
To: Dmitry Dolgov <9erthalion6@gmail.com>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: Marko Tiikkaja <marko@joh.to>
Cc: PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Subject: Re: BUG #14849: jsonb_build_object doesn't like VARIADIC calls very much
Date: Wed, 18 Oct 2017 13:54:26 -0400
Message-ID: <dbde1be7-d9d7-0951-f976-b8118da66199@2ndQuadrant.com> (raw)
In-Reply-To: <CA+q6zcWc=yE8XkOK+w58+sW_K+crFU-Xa48UKh5R0PFDEi6uEg@mail.gmail.com>
References: <20171011020058.27986.42308@wrigleys.postgresql.org>
	<CAB7nPqSDHmjE-6HS-RUufZMEc6qipBDNjL1HktcMagVn7pGOcw@mail.gmail.com>
	<76ff5ede-99a7-536b-4c26-0db0748ea6e1@2ndQuadrant.com>
	<CAB7nPqTP9B_FLDGL=dPx5iGqKTJSENfvD=PoOy=zzC1AmmM55A@mail.gmail.com>
	<CA+q6zcU=6CcmdAdW=J9o-ukmyKYLLL=6-cHYPZNLN5JQr4wRRw@mail.gmail.com>
	<CAB7nPqTppc5w2nX7jaSu94V+VHfThbvRq12hmLrSiiN6ii1spA@mail.gmail.com>
	<CAB7nPqRDvken_V70kGXX3=9w4D9zM9-jj2gfg6pMyjpRzaSvPQ@mail.gmail.com>
	<CA+q6zcUyiqG8HezQT2U+78udtMPeOFiXD9dRmT5saYtESckOpw@mail.gmail.com>
	<CAB7nPqTsuq=rnM8PQGxNS3Gh=JQQp4RmdPxGLGXSV648X4yfhA@mail.gmail.com>
	<CA+q6zcWNs_j5pd_+j6JbFXe7M=n9NX8h0Emb1pux7Ap=w=DWrA@mail.gmail.com>
	<CAB7nPqTh-Oo-FxurwDq6V8sfR2yNc-2PE7CB4RrnM8ewwS8Z9A@mail.gmail.com>
	<CA+q6zcWc=yE8XkOK+w58+sW_K+crFU-Xa48UKh5R0PFDEi6uEg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>



On 10/18/2017 11:47 AM, Dmitry Dolgov wrote:
> > On 16 October 2017 at 02:08, Michael Paquier
> <michael.paquier@gmail.com <mailto:michael.paquier@gmail.com>> wrote:
> >
> >> Thanks for the patch. Everything looks fine, I just have one question -
> >> maybe it makes sense to put this pattern `if (variadic) {/*...*/}`
> into a
> >> separate function? Because from what I see it's basically one part
> of code
> >> (I didn't spot any difference) repeated four times for every function.
> >
> > The json/jsonb calls have one difference though. For jsonb, arguments
> > with unknown type are enforced to text, which is not the case of json,
> > and we don't want to change that behavior.
>
> Oh, actually what I meant is to put into a separate function only the
> first
> branch of this condition, i.e. when `variadic` is true. But in general
> I don't
> really have strong opinion about that, so if you think that this
> repetition is
> not a problem, then fine.
>
> > There is a common place for JSON-common code in jsonapi.c, but
> jsonapi.h is
> > wanted as light-weight (see its set of headers), so moving things
> there is
> > incorrect as well IMO.
>
> Hm...did you mean `jsonfuncs.c` and `jsonapi.h`? It seems to me, that this
> potential function (to handle `variadic` case) would not really
> pollute it.



If we really wanted to we could have it as a parameter to the function
to do the special UNKONOWNOID handling or not.

But I'm not sure it's worth it, especially on the back branches where we
should try to do minimal code disturbance.

cheers

andrew

-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (33+ messages)  latest in thread

Message-ID: <dbde1be7-d9d7-0951-f976-b8118da66199@2ndQuadrant.com>
Permalink:  ../dbde1be7-d9d7-0951-f976-b8118da66199@2ndQuadrant.com/
Also on:    postgresql.org/message-id/dbde1be7-d9d7-0951-f976-b8118da66199@2ndQuadrant.com

 · 

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-bugs@postgresql.org
  Cc: andrew.dunstan@2ndquadrant.com, 9erthalion6@gmail.com, michael.paquier@gmail.com, marko@joh.to
  Subject: Re: BUG #14849: jsonb_build_object doesn't like VARIADIC calls very much
  In-Reply-To: <dbde1be7-d9d7-0951-f976-b8118da66199@2ndQuadrant.com>
  References: <20171011020058.27986.42308@wrigleys.postgresql.org> <CAB7nPqSDHmjE-6HS-RUufZMEc6qipBDNjL1HktcMagVn7pGOcw@mail.gmail.com> <76ff5ede-99a7-536b-4c26-0db0748ea6e1@2ndQuadrant.com> <CAB7nPqTP9B_FLDGL=dPx5iGqKTJSENfvD=PoOy=zzC1AmmM55A@mail.gmail.com> <CA+q6zcU=6CcmdAdW=J9o-ukmyKYLLL=6-cHYPZNLN5JQr4wRRw@mail.gmail.com> <CAB7nPqTppc5w2nX7jaSu94V+VHfThbvRq12hmLrSiiN6ii1spA@mail.gmail.com> <CAB7nPqRDvken_V70kGXX3=9w4D9zM9-jj2gfg6pMyjpRzaSvPQ@mail.gmail.com> <CA+q6zcUyiqG8HezQT2U+78udtMPeOFiXD9dRmT5saYtESckOpw@mail.gmail.com> <CAB7nPqTsuq=rnM8PQGxNS3Gh=JQQp4RmdPxGLGXSV648X4yfhA@mail.gmail.com> <CA+q6zcWNs_j5pd_+j6JbFXe7M=n9NX8h0Emb1pux7Ap=w=DWrA@mail.gmail.com> <CAB7nPqTh-Oo-FxurwDq6V8sfR2yNc-2PE7CB4RrnM8ewwS8Z9A@mail.gmail.com> <CA+q6zcWc=yE8XkOK+w58+sW_K+crFU-Xa48UKh5R0PFDEi6uEg@mail.gmail.com> <dbde1be7-d9d7-0951-f976-b8118da66199@2ndQuadrant.com>

* 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