Re: discover a toast table name

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Eric Anderson Vianet SAO" <eric(at)vianet-express(dot)com(dot)br>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: discover a toast table name
Date: 2003-05-27 14:20:12
Message-ID: 15000.1054045212@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Eric Anderson Vianet SAO" <eric(at)vianet-express(dot)com(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jodi Kanter 2003-05-27 14:28:15 [Fwd: SQL book]
Previous Message Eric Anderson Vianet SAO 2003-05-27 13:23:09 discover a toast table name