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

From Tom Lane
Subject Re: UPDATE: pg_dump fails due to invalid memory request
Date
Msg-id 9189.1125873957@sss.pgh.pa.us
Whole thread Raw
In response to Re: UPDATE: pg_dump fails due to invalid memory request  (Michael Fuhr <mike@fuhr.org>)
List pgsql-novice
Michael Fuhr <mike@fuhr.org> writes:
> 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.

printtup() in src/backend/access/common/printtup.c forcibly detoasts
toasted datums in order to avoid memory leaks.  I'm not sure this is
still necessary.  COPY used to do something similar, but now it prefers
to call datatype-specific functions in a short-term memory context
that it can reset after every tuple.

[ this whole thread seems very far off topic for -novice, by the by. ]

            regards, tom lane

pgsql-novice by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: UPDATE: pg_dump fails due to invalid memory request
Next
From: Tom Lane
Date:
Subject: Re: problems when comparing text with special chars