Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQIbB-0001tB-O3 for pgsql-hackers@arkaria.postgresql.org; Sun, 08 Jan 2017 18:53:45 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cQIbB-000827-1W for pgsql-hackers@arkaria.postgresql.org; Sun, 08 Jan 2017 18:53:45 +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 1cQIZl-0006Sp-18 for pgsql-hackers@postgresql.org; Sun, 08 Jan 2017 18:52:17 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cQIZd-00073k-Il for pgsql-hackers@postgresql.org; Sun, 08 Jan 2017 18:52:16 +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 v08Iq3N6011490; Sun, 8 Jan 2017 13:52:04 -0500 From: Tom Lane To: Nikita Glukhov cc: Aleksander Alekseev , Michael Paquier , PostgreSQL mailing lists Subject: Re: PATCH: recursive json_populate_record() In-reply-to: <1b72a62e-fd94-fd6d-c573-870af0c8600d@postgrespro.ru> References: <222c7cfb-73c8-a56e-7844-3dc51682760d@postgrespro.ru> <20161227131541.GA6976@e733.localdomain> <1b72a62e-fd94-fd6d-c573-870af0c8600d@postgrespro.ru> Comments: In-reply-to Nikita Glukhov message dated "Wed, 28 Dec 2016 03:13:56 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <11488.1483901523.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 08 Jan 2017 13:52:03 -0500 Message-ID: <11489.1483901523@sss.pgh.pa.us> X-Pg-Spam-Score: -5.1 (-----) 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 Nikita Glukhov writes: > [ 0001_recursive_json_populate_record_v02.patch ] > [ 0002_assign_ndims_to_record_function_result_types_v02.patch ] I do not see the point of the second one of these, and it adds no test case showing why it would be needed. The example you quoted at the start of the thread doesn't fail for me in HEAD, so I surmise that it's falling foul of some assertion you added in the 0001 patch, but if so I think that assertion is wrong. attndims is really syntactic sugar only and doesn't affect anything meaningful semantically. Here is an example showing why it shouldn't: regression=3D# create table foo (d0 _int4, d1 int[], d2 int[3][4]); CREATE TABLE regression=3D# select attname,atttypid,attndims from pg_attribute where att= relid =3D 'foo'::regclass and attnum > 0; attname | atttypid | attndims=20 ---------+----------+---------- d0 | 1007 | 0 d1 | 1007 | 1 d2 | 1007 | 2 (3 rows) Columns d0,d1,d2 are really all of the same type, and any code that treats d0 and d1 differently is certainly broken. So there should be no need to track a particular attndims for an output column of a function result, and in most cases it's not clear to me where you would get an attndims value from anyway. regards, tom lane --=20 Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers