Re: UPDATE: pg_dump fails due to invalid memory request - Mailing list pgsql-novice

From Michael Fuhr
Subject Re: UPDATE: pg_dump fails due to invalid memory request
Date
Msg-id 20050903225941.GA3582@winnie.fuhr.org
Whole thread Raw
In response to Re: UPDATE: pg_dump fails due to invalid memory request  ("Morgan Kita" <mkita@verseon.com>)
Responses Re: UPDATE: pg_dump fails due to invalid memory request
List pgsql-novice
On Sat, Sep 03, 2005 at 01:48:49PM -0700, Morgan Kita wrote:
> Can someone explain to me why one works and not the other without
> PG_DETOAST_DATUM?

I don't know, but I'd guess that SELECT does some intermediate
processing that detoasts the data before it gets to the type's
output function.  Maybe one of the developers will explain what's
happening.

> Also can someone tell me how to easily tell how much data for a
> particular table is being toasted?

Look at the sizes of the table and its toast table.  If your
statistics are up to date on both, then a query like the following
should work:

SELECT c.relpages AS tablepages, t.relpages AS toastpages
FROM pg_class AS c JOIN pg_class AS t ON t.oid = c.reltoastrelid
WHERE c.relname = 'tablename';

See also the contrib/dbsize module (which will move into the standard
backend in 8.1).

--
Michael Fuhr

pgsql-novice by date:

Previous
From: "Morgan Kita"
Date:
Subject: Re: UPDATE: pg_dump fails due to invalid memory request
Next
From: Kim Adil
Date:
Subject: Inherritance question