Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j0Fyb-0005AE-Tk for pgsql-admin@arkaria.postgresql.org; Sat, 08 Feb 2020 02:36:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j0Fya-0002lo-N2 for pgsql-admin@arkaria.postgresql.org; Sat, 08 Feb 2020 02:36:08 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1j0Fya-0002lh-Dh for pgsql-admin@lists.postgresql.org; Sat, 08 Feb 2020 02:36:08 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j0FyY-0005UD-Dj for pgsql-admin@postgresql.org; Sat, 08 Feb 2020 02:36:08 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 0182a38N031015; Fri, 7 Feb 2020 21:36:03 -0500 From: Tom Lane To: Wells Oliver cc: pgsql-admin Subject: Re: plpgsql, dynamic variable lengths.. In-reply-to: References: <29969.1581127784@sss.pgh.pa.us> Comments: In-reply-to Wells Oliver message dated "Fri, 07 Feb 2020 18:23:31 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <31013.1581129363.1@sss.pgh.pa.us> Date: Fri, 07 Feb 2020 21:36:03 -0500 Message-ID: <31014.1581129363@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Wells Oliver writes: > Yes, but the issue is it won't always be three params, and not always the > same variable in $1, $2, etc. It depends on which keys are present in the > passed JSON object. Which I why I think I need to do something else like > create a recordset and pass that in USING, or something. Just can't quite > figure it out... Maybe just pass the JSON object as the only USING param, and do the field selections in the SQL fragments? regards, tom lane