Addition to TOAST documentation in 8.4 comprehensive manual

From: Aleksey Tsalolikhin <atsaloli(dot)tech(at)gmail(dot)com>
To: pgsql-docs(at)postgresql(dot)org
Subject: Addition to TOAST documentation in 8.4 comprehensive manual
Date: 2010-12-23 01:46:52
Message-ID: AANLkTikYArVJ0L_i9-VavbxB8iwB75yQ_wO=h1GswdUu@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Hello,

I'd like to suggest a small addition to the TOAST overview in the
8.4 comprehensive manual, Chapter 53.2 TOAST.

This is my first doc patch for postgres, so if this is not
appropriate, please advise. I spent almost an hour trying to figure
out how to go from the TOAST table id to the owning table name...
finally got help on #postgresql. Thought I'd document it for other
sys admins new to PostgreSQL.

Or is this something that would be better to go into the PostgreSQL Wiki?

Sincerely,
Aleksey

To find the parent table given a TOAST table, which has a name like
pg_toast_12513885, cast the OID of the toast table to "regclass".

For example: Given "monkeys" table which spills over to pg_toast_12513885:

select 12513885::regclass;
regclass
----------
monkeys
(1 row)

"regclass" stands for registered "class". Per RhodiumToad on #postgresql,
for reasons too complicated to explain, "class" is used to mean "relation".

Reference: "casting a table's OID to regclass is handy for symbolic
display of a numeric OID"
http://www.postgresql.org/docs/8.4/static/datatype-oid.html

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Aleksey Tsalolikhin 2010-12-23 02:05:22 Re: Addition to TOAST documentation in 8.4 comprehensive manual
Previous Message Leslie S Satenstein 2010-12-22 23:30:16 OID