Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e6IqK-0006fK-1A for pgsql-bugs@arkaria.postgresql.org; Sun, 22 Oct 2017 16:11:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1e6IqI-0001FL-U7 for pgsql-bugs@arkaria.postgresql.org; Sun, 22 Oct 2017 16:11:14 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e6IqE-00019g-QF for pgsql-bugs@postgresql.org; Sun, 22 Oct 2017 16:11:11 +0000 Received: from mail-yw0-x230.google.com ([2607:f8b0:4002:c05::230]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1e6IqB-0001Ln-Bc for pgsql-bugs@postgresql.org; Sun, 22 Oct 2017 16:11:09 +0000 Received: by mail-yw0-x230.google.com with SMTP id i198so10136053ywe.7 for ; Sun, 22 Oct 2017 09:11:07 -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=baYd9PYodaX3pesUxQtf8BcyqSulBFTGoQ5+8unftx4=; b=v8nInxrbXW7iHOd0zURkY12869Mpl4MrwgZKaka/AGcKi2HAwN7aFewnTxqnYb51Od dts102h2iKSZa6CICO34DntKYPaPuRXdrxcJ/L102bbulzI0efcTsdPPomRFenAgGiK1 ASVOW2ByWFpVB26tu/MmUglaR8wnEW1Dn8dz1owfsm2FXTdVmxv15bBwAcXT4djTnHVo qjrvScImEUzWNJZbNSHaCyK7xTRZi/wgKFvsJFOUws0+PK/71OideHR7aYLoaGTc981m 1Kb1rln5dvc82EagcD66lvhSaOFc6d5XrhdpmsKKY48bMnf0qlG0OzF+ntEOO6K2sfM+ YUtA== 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=baYd9PYodaX3pesUxQtf8BcyqSulBFTGoQ5+8unftx4=; b=dfFoDillDRO0tRi9Z0+eKTOkIs1uqari0n93rKo1iTvNOIbNRrqs+EnMR8k8jBKBoE qDr7PNXVhXFalLVnpmgf55j3zVnRN7Ptbs/Dv03SfMWYqzuu64ctOnGW7xzSSl+tXjAk EmRzTgNYZQAjmV9gqz95ZKqvEJ5hfewDLHBj8JLK8Vw91rDYQZYSL6s8SWlPiKCN6FlI 0rayZN6M+5hnheNB7dn3u4qsg5ljAV+hDQtUWepGNXKM7X0QvYt2w/7eSw4e52ZGR4Dk Ijxa0hGH5+maPW1wqC477mN9YN0PiPRIsi82pDzpQ/6/NpleE3lsVxLk8QobIMuPr7K8 Brjw== X-Gm-Message-State: AMCzsaVBylv55veOREPN7BVcaYdgIR0wRF5YnXqz1vPfnblwMqFWuGEf U0RUOtZ5OTDSpz/YP/Q/bwVl5MLlg2rzBCPR9c0RZXNudLaL4s+z4AgtggAgxRKwXu7J/qoOlAc lTN0SU7IVh+9sVOjXYfiZ9nNUuRhEoOZHTVhBSHZTBBNgV878HypZYYUg3y35RKK///oNJAE8b0 MvaxUyhRRi X-Google-Smtp-Source: ABhQp+QElQOhAUBvtGCqB1XpSZ3aO0B8W/moH7cZEv8fZWXP6XscTiJT2Vq2LKVMsg2FsSOYkIpheQ== X-Received: by 10.37.107.76 with SMTP id o12mr6754743ybm.466.1508688666206; Sun, 22 Oct 2017 09:11:06 -0700 (PDT) Received: from [192.168.10.146] ([98.122.175.38]) by smtp.gmail.com with ESMTPSA id z205sm2812653ywg.21.2017.10.22.09.11.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Oct 2017 09:11:05 -0700 (PDT) From: Andrew Dunstan X-Google-Original-From: Andrew Dunstan Subject: Re: 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 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:11:04 -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-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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. 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