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 1iD8S1-0001SB-Eh for pgsql-general@arkaria.postgresql.org; Wed, 25 Sep 2019 14:39:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iD8S0-0001mv-AD for pgsql-general@arkaria.postgresql.org; Wed, 25 Sep 2019 14:39:28 +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 1iD8S0-0001mg-06 for pgsql-general@lists.postgresql.org; Wed, 25 Sep 2019 14:39:28 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iD8Rt-0005Ac-Nh for pgsql-general@lists.postgresql.org; Wed, 25 Sep 2019 14:39:27 +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 x8PEdIZJ023238; Wed, 25 Sep 2019 10:39:20 -0400 From: Tom Lane To: Matt Andrews cc: pgsql-general@lists.postgresql.org Subject: Re: Mapping view columns to their source columns In-reply-to: References: <22840.1569387248@sss.pgh.pa.us> Comments: In-reply-to Matt Andrews message dated "Wed, 25 Sep 2019 15:26:15 +1000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23236.1569422358.1@sss.pgh.pa.us> Date: Wed, 25 Sep 2019 10:39:18 -0400 Message-ID: <23237.1569422358@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Matt Andrews writes: > Incidentally, I have become interested in the pg_node_tree type. I can't > find much info on it. Would that be in the source? What would be the first > steps for writing an extension for this sort of thing? pg_node_tree is just a serialization of the tree-of-Node-structs representation used inside the server. See src/include/nodes/primnodes.h and adjacent files for Node definitions. The actual serialization code is in src/backend/nodes/outfuncs.c and adjacent files. (Beware, however, that there's proposals floating around to change the serialization format.) regards, tom lane