exit_horribly vs exit_nicely in pg_dump

Поиск
Список
Период
Сортировка
Искать

exit_horribly vs exit_nicely in pg_dump

От:
Pavel Golub <pavel@microolap.com>
Дата:
Hello.

Examining pg_dump sources recently I've found that different exit
procedure used for the same situations.

A quick example from pg_dump.c:
       if (dataOnly && schemaOnly)               exit_horribly(NULL, "options -s/--schema-only and -a/--data-only cannot be used together\n");
       if (dataOnly && outputClean)               exit_horribly(NULL, "options -c/--clean and -a/--data-only cannot be used together\n");
       if (dump_inserts && oids)       {               write_msg(NULL, "options --inserts/--column-inserts and -o/--oids cannot be used together\n");               write_msg(NULL, "(The INSERT command cannot set OIDs.)\n");               exit_nicely(1);       }

I suppose this should be call to exit_nicely() for all possible cases.

The only need for calling exit_horribly() is when we are deep down in
the multithreaded code, AFAIK.

-- 
With best wishes,Pavel                          mailto:pavel@gf.microolap.com



Re: exit_horribly vs exit_nicely in pg_dump

От:
Peter Eisentraut <peter_e@gmx.net>
Дата:
On 11/5/13, 8:46 AM, Pavel Golub wrote:
> I suppose this should be call to exit_nicely() for all possible cases.
> 
> The only need for calling exit_horribly() is when we are deep down in
> the multithreaded code, AFAIK.

Doesn't hurt either, though.  But it would be OK to make this more
consistent.



Re: exit_horribly vs exit_nicely in pg_dump

От:
Bruce Momjian <bruce@momjian.us>
Дата:
Вложения:
On Wed, Nov  6, 2013 at 08:47:43AM -0500, Peter Eisentraut wrote:
> On 11/5/13, 8:46 AM, Pavel Golub wrote:
> > I suppose this should be call to exit_nicely() for all possible cases.
> > 
> > The only need for calling exit_horribly() is when we are deep down in
> > the multithreaded code, AFAIK.
> 
> Doesn't hurt either, though.  But it would be OK to make this more
> consistent.

Fixed in attached applied patch.

-- 
  Bruce Momjian          http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +
FAQ