pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL-documentation <pgsql-docs@postgresql.org>
Subject: 'literal' for numbers
Date: Mon, 7 Feb 2011 20:58:08 -0500 (EST)
Message-ID: <201102080158.p181w8J04985@momjian.us> (raw)
In-Reply-To: <AANLkTinvGSO2RXpmKvjQoA-6Ux7AxQB-T24GrsUBorcs@mail.gmail.com>

Robert Haas wrote:
> On Mon, Feb 7, 2011 at 10:08 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > Robert Haas <robertmhaas@gmail.com> 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 <literal> 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 <literal> 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 <literal> 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  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +



view thread (2+ messages)  latest in thread

Message-ID: <201102080158.p181w8J04985@momjian.us>
Permalink:  ../201102080158.p181w8J04985@momjian.us/
Also on:    postgresql.org/message-id/201102080158.p181w8J04985@momjian.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-docs@postgresql.org
  Cc: bruce@momjian.us, robertmhaas@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: 'literal' for numbers
  In-Reply-To: <201102080158.p181w8J04985@momjian.us>
  References: <AANLkTinvGSO2RXpmKvjQoA-6Ux7AxQB-T24GrsUBorcs@mail.gmail.com> <201102080158.p181w8J04985@momjian.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox