Re: Example not producing shown output

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: miodrag(dot)milic(at)gmail(dot)com, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Example not producing shown output
Date: 2019-11-26 18:28:18
Message-ID: 20191126182818.GC4161@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On 2019-Nov-25, Daniel Gustafsson wrote:

> > On 25 Nov 2019, at 13:05, PG Doc comments form <noreply(at)postgresql(dot)org> wrote:

> > Examples should have specified 'english'.
> >
> > Instead:
> > to_tsvector('fat cats ate rats') @@ to_tsquery('cat & rat')
> >
> > which returns fale on my own blank installation of Postgre (Serbian locale
> > Windows OS) instead of true:
> > to_tsvector('english', 'fat cats ate rats') @@ to_tsquery('cat & rat')
>
> I agree with this complaint, mainly since other examples on the page do specify
> english where required AFAICT, this makes it consistent.

Hmm. I'm not sure that it's an improvement to make all the examples
alike; that means we would not provide examples of the simpler syntax.
And because other examples already show that it's possible to indicate
the language, I'm not sure it's strictly necessary to do so here.

Maybe this complaint could be addressed by indicating in a note that
some examples might not work identically if run under a different
locale. Or perhaps we can add a second line in the example cell for the
@@ operator, to make it clear that both forms can be used. Users can be
expected to apply some intuition from that point onwards.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Daniel Gustafsson 2019-11-27 13:59:07 Re: Example not producing shown output
Previous Message Jonathan Buhacoff 2019-11-26 17:41:17 Re: legacy assumptions