Re: discover a toast table name - Mailing list pgsql-sql

From Tom Lane
Subject Re: discover a toast table name
Date
Msg-id 15000.1054045212@sss.pgh.pa.us
Whole thread Raw
In response to discover a toast table name  ("Eric Anderson Vianet SAO" <eric@vianet-express.com.br>)
Responses To ListAdms: Is pgsql-sql operating?  (Achilleus Mantzios <achill@matrix.gatewaynet.com>)
List pgsql-sql
"Eric Anderson Vianet SAO" <eric@vianet-express.com.br> writes:
> How can I discover which toast table referenced to a phisic table?

Look at the base table's pg_class row.  reltoastrelid is the OID of the
corresponding toast table.  So, for example, if I thought "text_tbl" had
such a problem:

regression=# select relname from pg_class where
regression-# oid = (select reltoastrelid from pg_class where relname = 'text_tbl');    relname
-----------------pg_toast_163219
(1 row)

regression=# reindex table pg_toast.pg_toast_163219;
REINDEX
regression=#
        regards, tom lane


pgsql-sql by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Many-to-Many relation
Next
From: Jodi Kanter
Date:
Subject: [Fwd: SQL book]