Re: [ADMIN] how to find a pg_toast table's primary table - Mailing list pgsql-admin

From Tom Lane
Subject Re: [ADMIN] how to find a pg_toast table's primary table
Date
Msg-id 6624.1481672778@sss.pgh.pa.us
Whole thread Raw
In response to Re: [ADMIN] how to find a pg_toast table's primary table  (Jerry Sievers <gsievers19@comcast.net>)
List pgsql-admin
Jerry Sievers <gsievers19@comcast.net> writes:
> ProPAAS DBA <dba@propaas.com> 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


pgsql-admin by date:

Previous
From: Jorge Torralba
Date:
Subject: Re: [ADMIN] how to find a pg_toast table's primary table
Next
From: koffi BADOH
Date:
Subject: [ADMIN] postgres account disabled . version 9.2