pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
To: Michael Paquier <michael.paquier@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: Marko Tiikkaja <marko@joh.to>
Cc: PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [BUGS] BUG #14849: jsonb_build_object doesn't like VARIADIC calls very much
Date: Sun, 22 Oct 2017 12:44:58 -0400
Message-ID: <d5f75b91-2dc2-6b50-06f9-bc53ed230d05@2ndQuadrant.com> (raw)
In-Reply-To: <f879f89d-1ea3-0d6a-a40f-4fd60fdce31d@2ndQuadrant.com>
References: <20171011020058.27986.42308@wrigleys.postgresql.org>
	<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>
	<CAB7nPqSr+3jHmoQvTX=MNeWMC0OTKf+tdn6uL9rgs1x4qgs22g@mail.gmail.com>
	<d06b1301-107a-016b-0139-93aeeacd51e4@2ndQuadrant.com>
	<CAB7nPqSf0jMiCpJcsQSg6s3xLiLry3WaqeKOviYA7XfFu6QCzQ@mail.gmail.com>
	<b7fcae21-7227-806c-5441-9470db9da608@2ndQuadrant.com>
	<CAB7nPqRkQ9YCiXfT3Ucn7XUx_yfmAsRTKxewfPGbaS1GczLnbw@mail.gmail.com>
	<18157.1508600622@sss.pgh.pa.us>
	<CAB7nPqTy_+gQ1e1++UxezR+41OkPoo-sPBfUj=QCLoBZqpSwfg@mail.gmail.com>
	<20566.1508604219@sss.pgh.pa.us>
	<CAB7nPqRegiLtjhrQK0jBs8FSJRy_sskP=-yUnTSMOD6FKjw2Rw@mail.gmail.com>
	<f879f89d-1ea3-0d6a-a40f-4fd60fdce31d@2ndQuadrant.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>



On 10/22/2017 12:11 PM, Andrew Dunstan wrote:
>
> On 10/21/2017 07:33 PM, Michael Paquier wrote:
>> On Sun, Oct 22, 2017 at 1:43 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> I don't think collecting all the arguments is particularly special ---
>>> format() or concat() for instance could possibly use this.  You might
>>> need an option to say what to do with unknown.
>> In this case, we could just use a boolean flag to decide if TEXTOID
>> should be enforced or not.
> A generic function is going to look a little more complicated than this,
> though. The functions as coded assume that the function has a single
> variadic argument. But for it to be useful generically it really needs
> to be able to work where there are both fixed and variadic arguments (a
> la printf style functions).
>
> I guess a simple way would be to make the caller tell the function where
> the variadic arguments start, or how many to skip, something like that.
>


here's a patch that works that way, based on Michael's code.

cheers

andrew

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



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



view thread (33+ messages)  latest in thread

Message-ID: <d5f75b91-2dc2-6b50-06f9-bc53ed230d05@2ndQuadrant.com>
Permalink:  ../d5f75b91-2dc2-6b50-06f9-bc53ed230d05@2ndQuadrant.com/
Also on:    postgresql.org/message-id/d5f75b91-2dc2-6b50-06f9-bc53ed230d05@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, michael.paquier@gmail.com, tgl@sss.pgh.pa.us, 9erthalion6@gmail.com, marko@joh.to, pgsql-hackers@postgresql.org
  Subject: Re: [BUGS] BUG #14849: jsonb_build_object doesn't like VARIADIC calls very much
  In-Reply-To: <d5f75b91-2dc2-6b50-06f9-bc53ed230d05@2ndQuadrant.com>
  References: <20171011020058.27986.42308@wrigleys.postgresql.org> <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> <CAB7nPqSr+3jHmoQvTX=MNeWMC0OTKf+tdn6uL9rgs1x4qgs22g@mail.gmail.com> <d06b1301-107a-016b-0139-93aeeacd51e4@2ndQuadrant.com> <CAB7nPqSf0jMiCpJcsQSg6s3xLiLry3WaqeKOviYA7XfFu6QCzQ@mail.gmail.com> <b7fcae21-7227-806c-5441-9470db9da608@2ndQuadrant.com> <CAB7nPqRkQ9YCiXfT3Ucn7XUx_yfmAsRTKxewfPGbaS1GczLnbw@mail.gmail.com> <18157.1508600622@sss.pgh.pa.us> <CAB7nPqTy_+gQ1e1++UxezR+41OkPoo-sPBfUj=QCLoBZqpSwfg@mail.gmail.com> <20566.1508604219@sss.pgh.pa.us> <CAB7nPqRegiLtjhrQK0jBs8FSJRy_sskP=-yUnTSMOD6FKjw2Rw@mail.gmail.com> <f879f89d-1ea3-0d6a-a40f-4fd60fdce31d@2ndQuadrant.com> <d5f75b91-2dc2-6b50-06f9-bc53ed230d05@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