Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2021-02-08 Thread Tom Lane
I wrote: > Bruce Momjian writes: >> On Sun, Feb 7, 2021 at 11:21:05AM +0100, Magnus Hagander wrote: >>> Isn't the whole "Success." at the end redundant here, and we should >>> just end the message after the pg_ctl command? So not just the extra >>> newline, but the whole thing? >> Agreed. > +1

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2021-02-07 Thread Tom Lane
Bruce Momjian writes: > On Sun, Feb 7, 2021 at 11:21:05AM +0100, Magnus Hagander wrote: >> Isn't the whole "Success." at the end redundant here, and we should >> just end the message after the pg_ctl command? So not just the extra >> newline, but the whole thing? > Agreed. +1

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2021-02-07 Thread Bruce Momjian
On Sun, Feb 7, 2021 at 11:21:05AM +0100, Magnus Hagander wrote: > > It appears that there is an extra blank line in the initdb output before > > "Success" now. > > Oops, clearly it does. > > That said, the full output is: > > """ > Success. You can now start the database server using: > >

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2021-02-07 Thread Magnus Hagander
On Wed, Feb 3, 2021 at 4:21 PM Peter Eisentraut wrote: > > On 2021-01-17 14:38, Magnus Hagander wrote: > > On Thu, Jan 7, 2021 at 11:53 AM Peter Eisentraut > > wrote: > >> > >> After pondering this again, I think we can go with initdb > >> --no-instructions, as in your patch. > >> > >> As a minor

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2021-02-03 Thread Peter Eisentraut
On 2021-01-17 14:38, Magnus Hagander wrote: On Thu, Jan 7, 2021 at 11:53 AM Peter Eisentraut wrote: After pondering this again, I think we can go with initdb --no-instructions, as in your patch. As a minor nitpick, I would leave out the else printf(_("\nSuccess.\n")); in the

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2021-01-17 Thread Magnus Hagander
On Thu, Jan 7, 2021 at 11:53 AM Peter Eisentraut wrote: > > After pondering this again, I think we can go with initdb > --no-instructions, as in your patch. > > As a minor nitpick, I would leave out the > > else > printf(_("\nSuccess.\n")); > > in the --no-instructions case. OK, tha

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2021-01-07 Thread Peter Eisentraut
After pondering this again, I think we can go with initdb --no-instructions, as in your patch. As a minor nitpick, I would leave out the else printf(_("\nSuccess.\n")); in the --no-instructions case. (I don't know where the pg_upgrade part of this discussion is right now.) -- Pet

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-25 Thread Michael Paquier
On Wed, Nov 25, 2020 at 04:25:56PM +0100, Magnus Hagander wrote: > On Wed, Nov 25, 2020 at 9:29 AM Peter Eisentraut > wrote: >> Perhaps it's worth asking whom the advice applies to then. You suggest >> it's mostly developers. I for one am still grumpy that in 9.5 we >> removed the variant of th

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-25 Thread Bruce Momjian
On Wed, Nov 25, 2020 at 10:33:09AM -0500, Tom Lane wrote: > Magnus Hagander writes: > > I guess one option could be to just remove it, unconditionally. And > > assume that any users who is running it manually read that in docs > > somewhere that tells them what to do next, and that any user who's

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-25 Thread Tom Lane
Magnus Hagander writes: > I guess one option could be to just remove it, unconditionally. And > assume that any users who is running it manually read that in docs > somewhere that tells them what to do next, and that any user who's > running it under a wrapper will have the wrapper set it up? I c

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-25 Thread Magnus Hagander
On Wed, Nov 25, 2020 at 9:29 AM Peter Eisentraut wrote: > > On 2020-11-24 13:32, Magnus Hagander wrote: > > I think it boils down to that today the output from initdb is entirely > > geared towards people running initdb directly and starting their > > server manually, and very few people outside t

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-25 Thread Peter Eisentraut
On 2020-11-24 13:32, Magnus Hagander wrote: I think it boils down to that today the output from initdb is entirely geared towards people running initdb directly and starting their server manually, and very few people outside the actual PostgreSQL developers ever do that. But there are still a lot

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-24 Thread Bruce Momjian
On Tue, Nov 24, 2020 at 04:05:26PM +0100, Magnus Hagander wrote: > pg_upgrade is a somewhat different but also interesting case. I think > the actual progress output is more interesting in pg_upgrade as it's > more likely to take measurable amounts of time. Whereas in initdb, > it's actually the "d

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-24 Thread Magnus Hagander
On Tue, Nov 24, 2020 at 3:12 PM Bruce Momjian wrote: > > On Tue, Nov 24, 2020 at 01:32:45PM +0100, Magnus Hagander wrote: > > I think it boils down to that today the output from initdb is entirely > > geared towards people running initdb directly and starting their > > server manually, and very fe

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-24 Thread Bruce Momjian
On Tue, Nov 24, 2020 at 01:32:45PM +0100, Magnus Hagander wrote: > I think it boils down to that today the output from initdb is entirely > geared towards people running initdb directly and starting their > server manually, and very few people outside the actual PostgreSQL > developers ever do that

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-24 Thread Magnus Hagander
On Fri, Nov 20, 2020 at 4:46 PM Peter Eisentraut wrote: > > On 2020-11-09 13:05, Magnus Hagander wrote: > > PFA a rebased version of this patch on top of what has happened since, > > and changing the pg_upgrade parameter to be --no-scripts. > > It seems were are still finding out more nuances abou

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-20 Thread Peter Eisentraut
On 2020-11-09 13:05, Magnus Hagander wrote: PFA a rebased version of this patch on top of what has happened since, and changing the pg_upgrade parameter to be --no-scripts. It seems were are still finding out more nuances about pg_upgrade, but looking at initdb for moment, I think the solution

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-11 Thread Bruce Momjian
On Wed, Nov 11, 2020 at 05:39:10PM +0100, Magnus Hagander wrote: > On Wed, Nov 11, 2020 at 5:38 PM Bruce Momjian wrote: > > > > On Wed, Nov 11, 2020 at 11:21:22AM -0500, Bruce Momjian wrote: > > > On Wed, Nov 11, 2020 at 05:11:38PM +0100, Magnus Hagander wrote: > > > > > In summary, I think the va

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-11 Thread Magnus Hagander
On Wed, Nov 11, 2020 at 5:38 PM Bruce Momjian wrote: > > On Wed, Nov 11, 2020 at 11:21:22AM -0500, Bruce Momjian wrote: > > On Wed, Nov 11, 2020 at 05:11:38PM +0100, Magnus Hagander wrote: > > > > In summary, I think the vacuumdb --analyze is now a one-line command, > > > > but the delete part can

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-11 Thread Bruce Momjian
On Wed, Nov 11, 2020 at 11:21:22AM -0500, Bruce Momjian wrote: > On Wed, Nov 11, 2020 at 05:11:38PM +0100, Magnus Hagander wrote: > > > In summary, I think the vacuumdb --analyze is now a one-line command, > > > but the delete part can be complex and not easily typed. > > > > I definitely agree to

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-11 Thread Bruce Momjian
On Wed, Nov 11, 2020 at 05:11:38PM +0100, Magnus Hagander wrote: > > Uh, pg_upgrade does enumerate things like tablespaces in > > create_script_for_old_cluster_deletion(). I think config file locations > > are beyond the scope of what we want pg_upgrade to handle. > > Ah, that's right. Forgot tha

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-11 Thread Magnus Hagander
On Wed, Nov 11, 2020 at 4:53 PM Bruce Momjian wrote: > > On Mon, Nov 2, 2020 at 02:23:35PM +0100, Magnus Hagander wrote: > > On Tue, Oct 27, 2020 at 12:40 PM Bruce Momjian wrote: > > > > > > On Tue, Oct 27, 2020 at 12:35:56PM +0100, Peter Eisentraut wrote: > > > > On 2020-10-27 11:53, Bruce Momj

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-11 Thread Bruce Momjian
On Mon, Nov 2, 2020 at 02:23:35PM +0100, Magnus Hagander wrote: > On Tue, Oct 27, 2020 at 12:40 PM Bruce Momjian wrote: > > > > On Tue, Oct 27, 2020 at 12:35:56PM +0100, Peter Eisentraut wrote: > > > On 2020-10-27 11:53, Bruce Momjian wrote: > > > > On Tue, Oct 27, 2020 at 11:35:25AM +0100, Peter

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-09 Thread Alvaro Herrera
On 2020-Nov-09, Magnus Hagander wrote: > On Mon, Nov 9, 2020 at 3:29 PM Alvaro Herrera wrote: > > > > How about a switch like "--with-scripts=" where the list can be > > "all" to include everything (default), "none" to include nothing, or a > > comma-separated list of things to include? (Also "-

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-09 Thread Magnus Hagander
On Mon, Nov 9, 2020 at 3:29 PM Alvaro Herrera wrote: > > On 2020-Nov-09, Magnus Hagander wrote: > > > But for usability that makes less sense. For the delete script, the > > wrapper (that the switch is intended for) knows more than pg_upgrade > > about how to delete it, so it can do a better job,

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-09 Thread Alvaro Herrera
On 2020-Nov-09, Magnus Hagander wrote: > But for usability that makes less sense. For the delete script, the > wrapper (that the switch is intended for) knows more than pg_upgrade > about how to delete it, so it can do a better job, and thus it makes > sense to silence it. But for something like t

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-09 Thread Magnus Hagander
On Mon, Nov 9, 2020 at 2:18 PM Anastasia Lubennikova wrote: > > On 02.11.2020 16:23, Magnus Hagander wrote: > > On Tue, Oct 27, 2020 at 11:35:25AM +0100, Peter Eisentraut wrote: > > On 2020-10-06 12:26, Magnus Hagander wrote: > > I went with the name --no-instructions to have the same name for bot

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-09 Thread Anastasia Lubennikova
On 02.11.2020 16:23, Magnus Hagander wrote: On Tue, Oct 27, 2020 at 11:35:25AM +0100, Peter Eisentraut wrote: On 2020-10-06 12:26, Magnus Hagander wrote: I went with the name --no-instructions to have the same name for both initdb and pg_upgrade. The downside is that "no-instructions" also caus

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-09 Thread Magnus Hagander
On Mon, Nov 2, 2020 at 2:23 PM Magnus Hagander wrote: > > On Tue, Oct 27, 2020 at 12:40 PM Bruce Momjian wrote: > > > > On Tue, Oct 27, 2020 at 12:35:56PM +0100, Peter Eisentraut wrote: > > > On 2020-10-27 11:53, Bruce Momjian wrote: > > > > On Tue, Oct 27, 2020 at 11:35:25AM +0100, Peter Eisentr

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-11-02 Thread Magnus Hagander
On Tue, Oct 27, 2020 at 12:40 PM Bruce Momjian wrote: > > On Tue, Oct 27, 2020 at 12:35:56PM +0100, Peter Eisentraut wrote: > > On 2020-10-27 11:53, Bruce Momjian wrote: > > > On Tue, Oct 27, 2020 at 11:35:25AM +0100, Peter Eisentraut wrote: > > > > On 2020-10-06 12:26, Magnus Hagander wrote: > >

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-10-27 Thread Bruce Momjian
On Tue, Oct 27, 2020 at 12:35:56PM +0100, Peter Eisentraut wrote: > On 2020-10-27 11:53, Bruce Momjian wrote: > > On Tue, Oct 27, 2020 at 11:35:25AM +0100, Peter Eisentraut wrote: > > > On 2020-10-06 12:26, Magnus Hagander wrote: > > > > I went with the name --no-instructions to have the same name

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-10-27 Thread Peter Eisentraut
On 2020-10-27 11:53, Bruce Momjian wrote: On Tue, Oct 27, 2020 at 11:35:25AM +0100, Peter Eisentraut wrote: On 2020-10-06 12:26, Magnus Hagander wrote: I went with the name --no-instructions to have the same name for both initdb and pg_upgrade. The downside is that "no-instructions" also causes

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-10-27 Thread Magnus Hagander
On Tue, Oct 27, 2020 at 11:53 AM Bruce Momjian wrote: > On Tue, Oct 27, 2020 at 11:35:25AM +0100, Peter Eisentraut wrote: > > On 2020-10-06 12:26, Magnus Hagander wrote: > > > I went with the name --no-instructions to have the same name for both > > > initdb and pg_upgrade. The downside is that "

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-10-27 Thread Bruce Momjian
On Tue, Oct 27, 2020 at 11:35:25AM +0100, Peter Eisentraut wrote: > On 2020-10-06 12:26, Magnus Hagander wrote: > > I went with the name --no-instructions to have the same name for both > > initdb and pg_upgrade. The downside is that "no-instructions" also > > causes the scripts not to be written i

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-10-27 Thread Peter Eisentraut
On 2020-10-06 12:26, Magnus Hagander wrote: I went with the name --no-instructions to have the same name for both initdb and pg_upgrade. The downside is that "no-instructions" also causes the scripts not to be written in pg_upgrade, which arguably is a different thing. We could go with "--no-in

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-10-06 Thread Michael Paquier
On Tue, Oct 06, 2020 at 11:22:11AM -0400, Bruce Momjian wrote: > On Tue, Oct 6, 2020 at 11:06:13AM -0400, Tom Lane wrote: >> OK. FWIW, I'd vote for separate --no-instructions and --no-scripts >> switches. > > Works for me. +1. -- Michael signature.asc Description: PGP signature

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-10-06 Thread Bruce Momjian
On Tue, Oct 6, 2020 at 11:06:13AM -0400, Tom Lane wrote: > Magnus Hagander writes: > > On Tue, Oct 6, 2020 at 4:31 PM Tom Lane wrote: > >> Hm, does it matter? I think those wrappers send the output to /dev/null > >> anyway. > > > The debian ones don't, because they consider it useful informati

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-10-06 Thread Tom Lane
Magnus Hagander writes: > On Tue, Oct 6, 2020 at 4:31 PM Tom Lane wrote: >> Hm, does it matter? I think those wrappers send the output to /dev/null >> anyway. > The debian ones don't, because they consider it useful information to the > user. I'd say that it is, especially in the case of pg_upg

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-10-06 Thread Magnus Hagander
On Tue, Oct 6, 2020 at 4:31 PM Tom Lane wrote: > Magnus Hagander writes: > > The use case for this is for example the debian or redhat package > wrappers. > > When these commands are run under those wrappers the printed instructions > > are *wrong*. It's better in that case to exclude them, and

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-10-06 Thread Tom Lane
Magnus Hagander writes: > The use case for this is for example the debian or redhat package wrappers. > When these commands are run under those wrappers the printed instructions > are *wrong*. It's better in that case to exclude them, and let the wrapper > be responsible for printing the correct i

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-10-06 Thread Magnus Hagander
On Tue, Oct 6, 2020 at 1:49 PM Ian Lawrence Barwick wrote: > 2020年10月6日(火) 19:26 Magnus Hagander : > > > > The attached patch adds a switch --no-instructions to initdb and > pg_upgrade, which prevents them from printing instructions about how to > start the cluster (initdb) or how to analyze and

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2020-10-06 Thread Ian Lawrence Barwick
2020年10月6日(火) 19:26 Magnus Hagander : > > The attached patch adds a switch --no-instructions to initdb and pg_upgrade, > which prevents them from printing instructions about how to start the cluster > (initdb) or how to analyze and delete clusters (pg_upgrade). > > The use case for this is for ex

Prevent printing "next step instructions" in initdb and pg_upgrade

2020-10-06 Thread Magnus Hagander
The attached patch adds a switch --no-instructions to initdb and pg_upgrade, which prevents them from printing instructions about how to start the cluster (initdb) or how to analyze and delete clusters (pg_upgrade). The use case for this is for example the debian or redhat package wrappers. When t