Thread: need a bit of help

need a bit of help

From
Warren Little
Date:
Hello,
got myself in a pickle with the database running out of space.

I have a question regarding pg_toast tables and their relationships to
the parent tables.

If I run the following query
select * from pg_class where
reltoastrelid like '%944' or reltoastidxid like '%944'

I receive a single row:
pg_toast_62130940,99,62130943,39934,0,62130942,0,7602767,3.04112e
+07,0,62130944,t,f,t,3,0,0,0,0,0,f,t,f,f,

which appears to be the pg_toast entry.  Shouldn't there be a pg_class
whose reltoastrelid equals the reltoastidxid of the pg_toast instance

I'm trying to determine if I have some tuples that are not being
vacuumed.

thanks

--
Warren Little
Chief Technology Officer
Meridias Capital Inc
1018 W Atherton Dr
Salt Lake City, UT 84123
ph: 866.369.7763

Re: need a bit of help

From
Tom Lane
Date:
Warren Little <warren.little@meridiascapital.com> writes:
> which appears to be the pg_toast entry.  Shouldn't there be a pg_class
> whose reltoastrelid equals the reltoastidxid of the pg_toast instance

No.  The deal is

regular table's reltoastrelid points to OID of its toast table

toast table's reltoastidxid points to OID of its index

There's no "back links".

            regards, tom lane

Re: need a bit of help

From
Warren Little
Date:
ok

thanks

On Wed, 2006-04-26 at 19:22 -0400, Tom Lane wrote:
> Warren Little <warren.little@meridiascapital.com> writes:
> > which appears to be the pg_toast entry.  Shouldn't there be a pg_class
> > whose reltoastrelid equals the reltoastidxid of the pg_toast instance
>
> No.  The deal is
>
> regular table's reltoastrelid points to OID of its toast table
>
> toast table's reltoastidxid points to OID of its index
>
> There's no "back links".
>
>             regards, tom lane
--
Warren Little
Chief Technology Officer
Meridias Capital Inc
1018 W Atherton Dr
Salt Lake City, UT 84123
ph: 866.369.7763