Re: [PATCHES] Adding a --quiet option to initdb

From: Devrim GUNDUZ <devrim(at)commandprompt(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] Adding a --quiet option to initdb
Date: 2006-01-25 15:22:22
Message-ID: 1138202542.4018.21.camel@evim.gunduz.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Hi Andrew,

On Wed, 2006-01-25 at 09:28 -0500, Andrew Dunstan wrote:
> What's wrong with just sending stdout to /dev/null? If that eats error
> messages too then we should probably fix initdb to send those to
> stderr.

We have the same options with reindexdb, for example. I think a command
line option

> But if we are going to do this, then I also noticed a couple of
> things:
>
> . you should explicitly initialize the quiet variable, in keeping with
> the style of the others nearby.

Oh, I've missed it. Patch updated.

> . the idiom
>
> if (! quiet)
> {
> fputs(_("some message"),stdout);
> fflush(stdout);
> }
>
> should not be endlessly repeated. Make it a macro or a function.

I'm looking at it now.

Thanks for your comments. I'll provide a new patch soon, which will also
include Alvaro's suggestion about surpression both header and footer
(--make-initdb-really-quiet-mode :) )

Regards,
--
The PostgreSQL Company - Command Prompt, Inc. 1.503.667.4564
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, plPerlNG - http://www.commandprompt.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Devrim GUNDUZ 2006-01-25 15:26:53 Re: [PATCHES] Adding a --quiet option to initdb
Previous Message Alvaro Herrera 2006-01-25 14:29:10 Re: Suggestions for post-mortem...

Browse pgsql-patches by date

  From Date Subject
Next Message Devrim GUNDUZ 2006-01-25 15:26:53 Re: [PATCHES] Adding a --quiet option to initdb
Previous Message Andrew Dunstan 2006-01-25 14:28:04 Re: [PATCHES] Adding a --quiet option to initdb