Re: bug in GUC - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: bug in GUC
Date
Msg-id 20040624165542.GB2761@dcc.uchile.cl
Whole thread Raw
In response to Re: bug in GUC  ("Thomas Hallgren" <thhal@mailblocks.com>)
Responses Re: bug in GUC
List pgsql-hackers
On Thu, Jun 24, 2004 at 04:45:31PM +0200, Thomas Hallgren wrote:
> Ok, so I'm a newbie. To my defence I'll say that I made an effort to follow
> the style previously used in guc.c. The unchecked mallocs I added were not
> the first ;-)

Apparently Peter thought it was a good idea *not* to use palloc and
friends, and documented it.  The rationale seems to be "we have more
control over out-of-memory conditions", and if you look closely, the
out-of-memory is handled at a lower level than ERROR if it's not
processing interactively.  For example, when reading the config file,
the ereport is DEBUG2.

I'm not sure exactly why this is a good idea.  After all, if the systems
runs out of memory while starting up, what can be expected later?  Not a
lot is going to work.

> So, what you are saying is that there's no need for the functions I
> suggested and that a palloc using the TopMemoryContext will guarantee
> correct behavior on "out of memory"?

IMO yes and yes.

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"La felicidad no es mañana. La felicidad es ahora"



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [Re] Re: PREPARE and transactions
Next
From: Tom Lane
Date:
Subject: Re: [Re] Re: PREPARE and transactions