Re: [BUGS] your mail - Mailing list pgsql-bugs

From Tom Lane
Subject Re: [BUGS] your mail
Date
Msg-id 25045.1502230355@sss.pgh.pa.us
Whole thread Raw
In response to Re: [BUGS] your mail  (Andres Freund <andres@anarazel.de>)
List pgsql-bugs
Andres Freund <andres@anarazel.de> writes:
> On 2017-08-08 17:12:14 -0400, Tom Lane wrote:
>> And it would cause a lot of code that *doesn't* assume that to fail,
>> too. That has basically nothing to do with not being in a transaction,
>> so I don't think it would be helpful here.

> Wouldn't mostsuch code be a bad idea anyway?

No, not really.  You're right that a palloc appearing directly in a
_PG_init function is a bit dubious, but that doesn't mean that _PG_init
can't call anything that allocates memory.  Also, since _PG_init is by
definition only called once per process, I do not think that authors
need to be rapped on the knuckles if they leak a small amount of
TopMemoryContext memory.

In any case, the result of doing that would only be that people would
throw in MemoryContextSwitchTo calls, it wouldn't discourage them from
trying to do catalog accesses for instance.
        regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: Jarred Ward
Date:
Subject: [BUGS] 9.6.3 - Backend Crash - Parallel Worker Prepared Statements
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] 9.6.3 - Backend Crash - Parallel Worker Prepared Statements