Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 62BED1337B7E for ; Sat, 22 Jan 2011 23:12:27 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 55274-01 for ; Sun, 23 Jan 2011 03:12:20 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 172411337B47 for ; Sat, 22 Jan 2011 23:12:19 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p0N3CGVL001335; Sat, 22 Jan 2011 22:12:16 -0500 (EST) To: Robert Haas cc: Greg Smith , Fujii Masao , Magnus Hagander , pgsql-hackers@postgresql.org Subject: Re: auto-sizing wal_buffers In-reply-to: References: <20767.1294964709@sss.pgh.pa.us> <4D314406.3000703@2ndquadrant.com> <4D31D0E4.9000108@2ndquadrant.com> <11561.1295742146@sss.pgh.pa.us> <29279.1295746434@sss.pgh.pa.us> <202.1295748502@sss.pgh.pa.us> <508.1295749488@sss.pgh.pa.us> <806.1295750546@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Sat, 22 Jan 2011 21:52:18 -0500" Date: Sat, 22 Jan 2011 22:12:16 -0500 Message-ID: <1334.1295752336@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201101/2212 X-Sequence-Number: 180049 Robert Haas writes: > On Sat, Jan 22, 2011 at 9:42 PM, Tom Lane wrote: >> It does strike me that we could provide SetConfigOptionInt, >> SetConfigOptionBool, and SetConfigOptionReal for the benefit of callers >> who'd prefer to pass values in those formats.  They'd still do sprintf >> internally, but this would make the call sites a bit cleaner. > Why do we need to double the conversion in the first place? Because most of the processing in set_config_option is independent of the type of the GUC variable. Maybe it could be refactored, but I don't think it would come out prettier, nor faster. Again, the important code paths are starting from string values anyway --- I don't think we should contort the design of guc.c to serve a small minority of callers at the expense of complicating the normal cases. regards, tom lane