Re: pg_upgrade version checking questions

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Christoph Berg <myon(at)debian(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Tomasz Szypowski <tomasz(dot)szypowski(at)gmail(dot)com>
Subject: Re: pg_upgrade version checking questions
Date: 2019-07-24 20:32:05
Message-ID: 3177834d-8313-c641-2d20-f99d69d8b6ff@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2019-07-23 17:30, Daniel Gustafsson wrote:
> The reason for moving is that we print default values in usage(), and that
> requires the value to be computed before calling usage(). We already do this
> for resolving environment values in parseCommandLine(). If we do it in setup,
> then we’d have to split out resolving the new_cluster.bindir into it’s own
> function exposed to option.c, or do you have any other suggestions there?

I think doing nontrivial work in order to print default values in
usage() is bad practice, because in unfortunate cases it would even
prevent you from calling --help. Also, in this case, it would probably
very often exceed the typical line length of --help output and create
some general ugliness. Writing something like "(default: same as this
pg_upgrade)" would probably achieve just about the same.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2019-07-24 20:34:00 Re: initdb recommendations
Previous Message Peter Eisentraut 2019-07-24 20:25:08 Re: Support for jsonpath .datetime() method