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 1gUCBJ-0002LE-Iw for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Dec 2018 15:00:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gUCBI-0000HI-BG for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Dec 2018 15:00:12 +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 1gUCBI-0000HA-3t for pgsql-hackers@lists.postgresql.org; Tue, 04 Dec 2018 15:00:12 +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 1gUCBA-0003iG-Uo for pgsql-hackers@lists.postgresql.org; Tue, 04 Dec 2018 15:00:11 +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 wB4F01Rv023924; Tue, 4 Dec 2018 10:00:01 -0500 From: Tom Lane To: Alvaro Herrera cc: Pg Hackers Subject: Re: psql display of foreign keys In-reply-to: <20181204143834.ym6euxxxi5aeqdpn@alvherre.pgsql> References: <20181204143834.ym6euxxxi5aeqdpn@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Tue, 04 Dec 2018 11:38:34 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23922.1543935600.1@sss.pgh.pa.us> Date: Tue, 04 Dec 2018 10:00:00 -0500 Message-ID: <23923.1543935600@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alvaro Herrera writes: > This is not very useful. I propose that we change it so that it only > displays the one on the partitioned table on which the constraint was > defined: OK goal, but ... > Patch attached. ... this patch breaks the expectation set at the top of describe.c: * Support for the various \d ("describe") commands. Note that the current * expectation is that all functions in this file will succeed when working * with servers of versions 7.4 and up. It's okay to omit irrelevant * information for an old server, but not to fail outright. Do you really need WITH RECURSIVE for this? If so, I'd suggest applying it only when relkind == RELKIND_PARTITIONED_TABLE, so that the case doesn't happen in servers too old to have WITH. That's probably a win performance-wise anyway, as I have no doubt that the performance of this query is awful compared to what it replaces, so we don't really want to use it if we don't have to. regards, tom lane