Re: psql show URL with help - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: psql show URL with help
Date
Msg-id aa2e4abb-00a9-76b8-fe96-594e9768f699@2ndquadrant.com
Whole thread Raw
In response to Re: psql show URL with help  (David Fetter <david@fetter.org>)
Responses Re: psql show URL with help
List pgsql-hackers
On 2019-03-07 23:02, David Fetter wrote:
>> if (psql_version_is_numeric)
>>  return /docs/psql_version/
>> else if (psql_version ends with 'devel')
>>   return /docs/devel/
>> else
>>   return /docs/{psql_version but with text stripped}/
>>
>> So that e.g. 12beta would return "12", as would 12rc or 12alpha. But
>> 12devel would return "devel".
> 
> That's exactly what I had in mind :)

The outcome of that is exactly what my patch does, but the inputs are
different.  We have PG_MAJORVERSION, which is always a single integer,
and PG_VERSION, which could be 10.9.8 or 11beta5 or 12devel.  The patch does

if (PG_VERSION ends with 'devel')
  return /docs/devel/
else
 return /docs/$PG_MAJORVERSION/

There is no third case.  Your third case of not-numeric-and-not-devel is
correctly covered by the else branch.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: House style for DocBook documentation?
Next
From: ilmari@ilmari.org (Dagfinn Ilmari Mannsåker)
Date:
Subject: Re: Pluggable Storage - Andres's take