Addition to TOAST documentation in 8.4 comprehensive manual - Mailing list pgsql-docs

From Aleksey Tsalolikhin
Subject Addition to TOAST documentation in 8.4 comprehensive manual
Date
Msg-id AANLkTikYArVJ0L_i9-VavbxB8iwB75yQ_wO=h1GswdUu@mail.gmail.com
Whole thread Raw
Responses Re: Addition to TOAST documentation in 8.4 comprehensive manual  (Aleksey Tsalolikhin <atsaloli.tech@gmail.com>)
List 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

pgsql-docs by date:

Previous
From: Leslie S Satenstein
Date:
Subject: OID
Next
From: Aleksey Tsalolikhin
Date:
Subject: Re: Addition to TOAST documentation in 8.4 comprehensive manual