Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e6JN5-00008T-Gx for pgsql-hackers@arkaria.postgresql.org; Sun, 22 Oct 2017 16:45:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1e6JN5-0007UQ-3Y for pgsql-hackers@arkaria.postgresql.org; Sun, 22 Oct 2017 16:45:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e6JN3-0007R6-O2 for pgsql-hackers@postgresql.org; Sun, 22 Oct 2017 16:45:05 +0000 Received: from mail-yw0-x22f.google.com ([2607:f8b0:4002:c05::22f]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1e6JMz-0002ms-OE for pgsql-hackers@postgresql.org; Sun, 22 Oct 2017 16:45:05 +0000 Received: by mail-yw0-x22f.google.com with SMTP id i198so10173097ywe.7 for ; Sun, 22 Oct 2017 09:45:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=272KTX8wFVGTeni/8JVVHiCUS0jCYMvFfTnOhQorSOQ=; b=x9jL+l+wmMfmzCfyLjWe4XvmGOAiA8mhciP10iIz3rKTbghMTzPqvT5n24xBCbJdJX kNMXd9WiQwoebXhLSRBNwLO3g+0fo4mNSBI0i1zhVm3nHAIqwIfiWfLlLxydX0Bq6IZy nOpQB15pMcDrYzpqZeB+SYYBnbJfuzQgHUZeBMImfCCprug2aCP5vQU3B+rv91D7ivHg Zi1rrrkwK6HfG1/uclU6ACnZ5I6gHLMUb0+6/eDbEpU4AQl9RF8V9xdNtcWoAvH19VB/ 2QlsiRH8Bp0Hn2BmSYnOtUib82KyU4oftjfrzCb8CdMWyZPkmC2xrwiPAzilLLq/WE5d R28w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=272KTX8wFVGTeni/8JVVHiCUS0jCYMvFfTnOhQorSOQ=; b=HS2hKViQ5bCl5Q3353mB10f0pLiUYDSv/pBKBWc6Koc0xLR79c431+3lqGCy1d1LjU Cv6GIE2SPNXR/BN7Kc5YRibZPgt8UvVi4qW68bn7pNuF97NICnd85fACRfJZ87OfZEkd NBij5NxHNcwLU8o1dZtJ5GWEl18lRgPyjy7abEzS9C6G4BCnesR0ZxkdL72qYm0BXRyQ OUT1WhQYAl8OXXqQR4qESKnfR+FAYCg7Kbkfx3cg+FMCC+KjaOwEzW7Fw2O/cXatNgZY nhLwR3eGSKsRYev6iz5fLNpIiwWIcVscdOmKph/QU2bfJMOAp5qcs4v9rMXSJ8EleS5y F4gQ== X-Gm-Message-State: AMCzsaXo63LWz90a3Qcv4vTwTtu0QryIz830cO2pY6dPxZTkhF/D+Je8 0ZFK2UdddSZgEWPUmV7dZS+0HZzjIrQB0QNv8OjdzH1w9iCM55ENoNp36WCb6gbX9ZQZKi3soDk 0J1dNWxMMHS/8GQ+2fVL7VaiMLuUbZYTd542AbBM4dk/E1vNjfXzN1ervYyYDG90BTD8UPRzC6g lGGsH5qTlmPXOJ X-Google-Smtp-Source: ABhQp+RslpInhuzXzMrK5MVNOc6PsPTQD9zxeJBOpBAyqJjI2n5qHv62B6b2BLQ5T/7za+q08aTFmQ== X-Received: by 10.37.172.217 with SMTP id x25mr6787447ybd.387.1508690699763; Sun, 22 Oct 2017 09:44:59 -0700 (PDT) Received: from [192.168.10.146] ([98.122.175.38]) by smtp.gmail.com with ESMTPSA id u2sm2827657ywi.82.2017.10.22.09.44.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Oct 2017 09:44:59 -0700 (PDT) From: Andrew Dunstan X-Google-Original-From: Andrew Dunstan Subject: Re: [BUGS] BUG #14849: jsonb_build_object doesn't like VARIADIC calls very much To: Michael Paquier , Tom Lane Cc: Dmitry Dolgov <9erthalion6@gmail.com>, Marko Tiikkaja , PostgreSQL mailing lists , PostgreSQL-development References: <20171011020058.27986.42308@wrigleys.postgresql.org> <18157.1508600622@sss.pgh.pa.us> <20566.1508604219@sss.pgh.pa.us> Message-ID: Date: Sun, 22 Oct 2017 12:44:58 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-MW List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org 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 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