Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGwnp-0002uy-JQ for pgsql-admin@arkaria.postgresql.org; Tue, 13 Dec 2016 23:48:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cGwnp-0007YR-6b for pgsql-admin@arkaria.postgresql.org; Tue, 13 Dec 2016 23:48:09 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cGwm9-0005OY-3Y for pgsql-admin@postgresql.org; Tue, 13 Dec 2016 23:46:25 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cGwm6-00051Q-7E for pgsql-admin@postgresql.org; Tue, 13 Dec 2016 23:46:23 +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 uBDNkIUk006625; Tue, 13 Dec 2016 18:46:18 -0500 From: Tom Lane To: Jerry Sievers cc: ProPAAS DBA , pgsql-admin@postgresql.org Subject: Re: how to find a pg_toast table's primary table In-reply-to: <86wpf3qu08.fsf@jerry.enova.com> References: <86wpf3qu08.fsf@jerry.enova.com> Comments: In-reply-to Jerry Sievers message dated "Tue, 13 Dec 2016 17:39:03 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6623.1481672778.1@sss.pgh.pa.us> Date: Tue, 13 Dec 2016 18:46:18 -0500 Message-ID: <6624.1481672778@sss.pgh.pa.us> X-Pg-Spam-Score: -5.0 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Jerry Sievers writes: > ProPAAS DBA writes: >> pg_toast.pg_toast_16784 >> How do I find the primary table for this toast table? > Find the pg_class row with reltoastrelid = $oid-of-toast-table. After you've done that a couple of times, you'll notice that the numeric part of the toast table's name is the OID of its parent, so really you just need to do select '16784'::regclass; Confirming the reltoastrelid link is a good idea though. regards, tom lane -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin