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

Re: Functions example results incorrect

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Thom Brown <thom(at)linux(dot)com>, pgsql-docs <pgsql-docs(at)postgresql(dot)org>
Subject: Re: Functions example results incorrect
Date: 2011-07-11 22:25:03
Message-ID: 201107112225.p6BMP3M08188@momjian.us (view raw or flat)
Thread:
Lists: pgsql-docs
Tom Lane wrote:
> Thom Brown <thom(at)linux(dot)com> writes:
> > On 1 July 2011 19:17, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> Thom Brown <thom(at)linux(dot)com> writes:
> >>> The quote literal example of quote_literal('O\'Reilly') doesn't work
> >>> on my installation by default.
> 
> >> Hmm, should we use an E'' literal there, or change the input to be
> >> 'O''Reilly'? The former would confuse people who didn't understand E''
> >> literals, while the latter would make it look like quote_literal wasn't
> >> doing anything at all, so neither alternative seems to offer much
> >> clarity.
> 
> > My concern is that people copying the example as a way to quote their
> > string literal will find that, by default, it doesn't work.  I'll
> > leave it to your better judgement though as I can see that the E''
> > notation could potentially confuse.   It is possible, either way, to
> > add a footnote to the example?
> 
> On further study, I notice that somebody already E-ified all the other
> examples where it was important; the quote_literal example simply got
> overlooked, I think.  It seems better to use E'' there than make the
> example potentially confusing as to what the function accomplishes.
> 
> Also, I looked at the examples for binary strings, and decided that
> converting the sample outputs to hex format would render the examples
> a lot less readable (since the inputs are not shown in that format).
> So instead I'm going to add this:
> 
>    <note>
>     <para>
>      The sample results shown on this page assume that the server parameter
>      <link linkend="guc-bytea-output"><varname>bytea_output</></link> is set
>      to <literal>escape</literal> (the traditional PostgreSQL format).
>     </para>
>    </note>

Please consider that the "traditional PostgreSQL format" is now not the
_default_ bytea_output format.  I think a lot of people equate
"traditional" with "default".

-- 
  Bruce Momjian  <bruce(at)momjian(dot)us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

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

In response to

Responses

pgsql-docs by date

Next:From: Tom LaneDate: 2011-07-11 23:05:02
Subject: Re: Functions example results incorrect
Previous:From: Emanuel CalvoDate: 2011-07-11 19:59:44
Subject: pg_stat_database not in the index 9.0.4

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