Tom Lane wrote:
> Rather than try to change a lot of elog call sites, what I'm thinking
> would be a good plan is to make the FATAL-exit case in elog.c always
> exit with exit(1) (right now it tests a couple of different conditions
> to decide what to return). Then, in the postmaster, consider an exit
> code of 1 to be either OK or not OK depending on which child it came
> from. I think there are a small number of exit(1) calls that might
> need to be changed to exit(2) because they are trying to force the
> postmaster to do a panic restart, but it should be a minimal patch.
I was going to suggest using symbolic names to exit codes instead of
hardcoding 1 or 2. We do that in Mammoth replicator, and use the exit
codes to determine whether the postmaster needs to take special action
for different replication scenarios, e.g. when one needs to promote a
master server to slave or vice versa.
--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.