exit_horribly vs exit_nicely in pg_dump - Mailing list pgsql-hackers

From Pavel Golub
Subject exit_horribly vs exit_nicely in pg_dump
Date
Msg-id 1324825379.20131105154608@gf.microolap.com
Whole thread Raw
Responses Re: exit_horribly vs exit_nicely in pg_dump  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
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
cannotbe used together\n");
 
       if (dataOnly && outputClean)               exit_horribly(NULL, "options -c/--clean and -a/--data-only cannot be
usedtogether\n");
 
       if (dump_inserts && oids)       {               write_msg(NULL, "options --inserts/--column-inserts and
-o/--oidscannot 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




pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: pgsql: Remove internal uses of CTimeZone/HasCTZSet.
Next
From: Stephen Frost
Date:
Subject: Re: Row-security writer-side checks proposal