Re: your mail

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Rick Otten <rottenwindfish(at)gmail(dot)com>, ronan(dot)dunklau(at)dalibo(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: your mail
Date: 2017-08-08 22:12:35
Message-ID: 25045.1502230355@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Andres Freund <andres(at)anarazel(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2017-08-08 22:35:32 Re: 9.6.3 - Backend Crash - Parallel Worker Prepared Statements
Previous Message Jarred Ward 2017-08-08 21:56:53 9.6.3 - Backend Crash - Parallel Worker Prepared Statements