Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 563361337B84 for ; Mon, 7 Feb 2011 21:58:15 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 70045-02 for ; Tue, 8 Feb 2011 01:58:09 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from momjian.us (momjian.us [70.90.9.53]) by mail.postgresql.org (Postfix) with ESMTP id ADA9E1337B54 for ; Mon, 7 Feb 2011 21:58:07 -0400 (AST) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id p181w8J04985; Mon, 7 Feb 2011 20:58:08 -0500 (EST) From: Bruce Momjian Message-Id: <201102080158.p181w8J04985@momjian.us> Subject: 'literal' for numbers In-Reply-To: To: Robert Haas Date: Mon, 7 Feb 2011 20:58:08 -0500 (EST) CC: Tom Lane , PostgreSQL-documentation X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" 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: 201102/39 X-Sequence-Number: 6387 Robert Haas wrote: > On Mon, Feb 7, 2011 at 10:08 AM, Tom Lane wrote: > > Robert Haas writes: > >> Which way did we more commonly do it before you applied this patch? > > > > We don't have a standard for this, and an undocumented patch applied > > without any discussion doesn't create one. ?It's hopeless to imagine > > that you'll ever achieve any uniformity that way. ?It won't last long > > if you do, since you're outnumbered by committers who won't be following > > whatever you think the convention is. > > > > I'm not even sure why you're trying --- I don't think it even makes > > sense to try to have a standard about this. ?I can easily imagine that > > integer constants might read better with in some contexts > > and better without in others. > > *reads patch more carefully* > > Here are my verdicts: > > advanced.sgml: good > array.sgml: good > backup.sgml: unsure > catalogs.sgml: bad > client-auth.sgml: bad > config.sgml: bad > func.sgml: bad > high-availability.sgml: bad > libpq.sgml: bad > runtime.sgml: bad > spi.sgml: unsure > tsearch2.sgml: good > > So I guess I'm back agreeing with you. Basically, it seems like we > ought to use if it's being used as a value that the user > might want to supply (e.g. "if you set this parameter to 0, then no > statements will be logged). It shouldn't use if it's just > being used as a number (e.g. "this query will return all airplanes > with a height of less than 30,000 feet"). The cases I'm unsure about > are the ones where we're talking about a return value (e.g. in the > event of an error, this function will return -1). Robert, based on your logic, the 'return -1' should not be literal because no one would type that in. Unless I hear otherwise I will work on a patch to match the rules you outlined above. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +