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