X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E6901D1B750 for ; Thu, 24 Jun 2004 14:02:51 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 83116-04 for ; Thu, 24 Jun 2004 17:02:47 +0000 (GMT) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by svr1.postgresql.org (Postfix) with ESMTP id 4532DD1B737 for ; Thu, 24 Jun 2004 14:02:46 -0300 (ADT) Received: from mr1.surnet.cl (av1.surnet.cl [216.155.73.168]) by svr4.postgresql.org (Postfix) with ESMTP id E27375AF4A0 for ; Thu, 24 Jun 2004 17:02:45 +0000 (GMT) Received: from smtp1.surnet.cl (216.155.73.168) by mr1.surnet.cl (7.0.024) id 403F6D2501B457A4; Thu, 24 Jun 2004 12:55:40 -0400 Received: from av1.surnet.cl ([216.155.73.168]) by smtp1.surnet.cl (MailMonitor for SMTP v1.2.2 ) ; Thu, 24 Jun 2004 12:55:40 -0400 (CLT) Received: from cluster.surnet.cl (216.155.73.164) by smtp1.surnet.cl (7.0.024) id 406CA66201864FB7; Thu, 24 Jun 2004 12:55:40 -0400 Received: from 216.155.88.75.dsl.surnet.cl (200.85.202.121) by cluster.surnet.cl (7.0.024) (authenticated as alvherre@surnet.cl) id 403C729000C86699; Thu, 24 Jun 2004 12:55:42 -0400 Received: by 216.155.88.75.dsl.surnet.cl (Postfix, from userid 500) id A8A511680F; Thu, 24 Jun 2004 12:55:42 -0400 (CLT) Date: Thu, 24 Jun 2004 12:55:42 -0400 From: Alvaro Herrera To: Thomas Hallgren Cc: pgsql-hackers@postgresql.org Subject: Re: bug in GUC Message-ID: <20040624165542.GB2761@dcc.uchile.cl> References: <20040624052712.GA7158@dcc.uchile.cl> <13534.1088085728@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.5.1i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200406/870 X-Sequence-Number: 55420 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 () "La felicidad no es maņana. La felicidad es ahora"