Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fQziC-0003wo-Lo for pgsql-general@arkaria.postgresql.org; Thu, 07 Jun 2018 18:32:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fQziB-0000Io-BZ for pgsql-general@arkaria.postgresql.org; Thu, 07 Jun 2018 18:32:39 +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.89) (envelope-from ) id 1fQziB-0000Ie-3Y for pgsql-general@lists.postgresql.org; Thu, 07 Jun 2018 18:32:39 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fQzi8-0006sQ-0m for pgsql-general@postgresql.org; Thu, 07 Jun 2018 18:32:38 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id DB61921BF0; Thu, 7 Jun 2018 14:32:34 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 07 Jun 2018 14:32:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=IcybqxY30DY35QFcqpBuPjJLX8bS8 3HVGL/cIa9ts6M=; b=s1d3Btj3rwNhmBXtY8f9FEUFN1nXb3vpuVWcdeQB/MF1G GB/3WD1G2d8nwK7cM5eIP2yiPoHUffZV4cCz42HM2Xe5npTlLlLNVru54UzLmeh+ 1DYuEk32Yz/AMPSem7MOoRCFHlCUXzuoxFZkQLLnjO4ZQmageMbx5QDSdHki2hvU sYwV4GmERVfefR+0BwS5J7El8qJMrUmv+xWMSP0wZWLEDTa87hrDC/teruQd5PYG kAjjMsu/4KRonOHo/RxVVPvZf0MmBZ0ny6ucpqfDcFiSH+jC193L1H8i8IJTWnHi 5xHCuyG/ayDR5kQXDUuzjyhAI0eiphsOgdVBMqrhg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=Icybqx Y30DY35QFcqpBuPjJLX8bS83HVGL/cIa9ts6M=; b=Yjux/5U1Bvrz3vP1YWa0OC kj4jNpwOFUNxYS9KF8bjX9EYl3pPj7+wnXogcJSkAZ7lyXecV5KxYIqdfWp+HOjp dCufAxnvY2dlyBUHawh1iUQcLki70/szuq23x0e+WWWLojpy/V3FjHqydfasN9ct 3fTbWbip8jIMeEtXQX8FXdJQk7WkP8nMyirv7p9fuR0fzH9cMvlYV9uOfG7b6+M1 H8uJDgdOrssR+z7q/ze+pNEDpay4TXuAnHx4x78MS4tUXDVRlqOy+3bpBbGKOdeD yds1MTJyoyaOFrvToWTKD70+aWMrK48rl0PmFrrDIiN7zKGdh6hIJwT9G6OwhAeg == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: from [192.168.1.3] (unknown [71.212.159.209]) by mail.messagingengine.com (Postfix) with ESMTPA id 299B91025D; Thu, 7 Jun 2018 14:32:34 -0400 (EDT) Subject: Re: json_populate_recordset To: Pavel Stehule Cc: pgsql-general References: <2a8ae0b7-1fd4-869a-a25e-d598968898c9@aklaver.com> From: Adrian Klaver Message-ID: <5c23fd93-ef7c-3b76-327c-334b91b1e710@aklaver.com> Date: Thu, 7 Jun 2018 11:32:33 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 06/07/2018 09:56 AM, Pavel Stehule wrote: > > > 2018-06-07 18:51 GMT+02:00 Adrian Klaver >: > > From here: > > https://www.postgresql.org/docs/10/static/functions-json.html > > > select * from json_populate_record(null::myrowtype, '{"a": 1, "b": > ["2", "a b"], "c": {"d": 4, "e": "a b c"}}') > > What is the null::myrowtype doing? > > > this function uses polymorphic parameters - its some like > > create or replace function fx(in anyelement, json) returns anyelement .. > > output polymorphic value requires minimally one input polymorphic value > for type specification. Postgres has not possibility to pass only > datatype - so pattern null:type is used instead. Alright, so it is bootstrapping a polymorphic type off null. Thanks. > > Regards > > Pavel > > > > Thanks, > -- > Adrian Klaver > adrian.klaver@aklaver.com > > -- Adrian Klaver adrian.klaver@aklaver.com