Re: [GENERAL] Small patch for PL/Perl Misbehavior with Runtime Error Reporting - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [GENERAL] Small patch for PL/Perl Misbehavior with Runtime Error Reporting
Date
Msg-id 661.1033789872@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] Small patch for PL/Perl Misbehavior with  (John Worsley <lx@openvein.com>)
List pgsql-hackers
John Worsley <lx@openvein.com> writes:
> Yeah, that's a cleaner solution. I take it anything pstrdup'd by
> PostgreSQL gets freed automatically by the backend?

Pretty much.  The only situation where it wouldn't be is if
CurrentMemoryContext is pointing at TopMemoryContext or another
long-lived context --- but we are *very* chary about how much code we
allow to run with such a setting.  User-definable functions can safely
assume that palloc'd space will live only long enough for them to return
something to their caller in it.
        regards, tom lane


pgsql-hackers by date:

Previous
From: John Worsley
Date:
Subject: Re: [GENERAL] Small patch for PL/Perl Misbehavior with
Next
From: Bruce Momjian
Date:
Subject: Re: Threaded Sorting