Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-docspgsql-hackerspgsql-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

pgsql-docs by date

Next:From: Tom LaneDate: 2004-06-24 17:29:13
Subject: Re: bug in GUC
Previous:From: James RobinsonDate: 2004-06-24 15:59:59
Subject: Re: [HACKERS] bug in GUC

pgsql-hackers by date

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

pgsql-patches by date

Next:From: Tom LaneDate: 2004-06-24 17:29:13
Subject: Re: bug in GUC
Previous:From: James RobinsonDate: 2004-06-24 15:59:59
Subject: Re: [HACKERS] bug in GUC

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group