Re: bug in GUC

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Thomas Hallgren <thhal(at)mailblocks(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: bug in GUC
Date: 2004-06-24 16:55:42
Message-ID: 20040624165542.GB2761@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers pgsql-patches

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"

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2004-06-24 17:29:13 Re: bug in GUC
Previous Message James Robinson 2004-06-24 15:59:59 Re: [HACKERS] bug in GUC

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2004-06-24 16:59:16 Re: [Re] Re: PREPARE and transactions
Previous Message Josh Berkus 2004-06-24 16:34:05 Re: 7.5-dev, pg_dumpall, dollarquoting

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2004-06-24 17:29:13 Re: bug in GUC
Previous Message James Robinson 2004-06-24 15:59:59 Re: [HACKERS] bug in GUC