initdb.c::main() too large - Mailing list pgsql-hackers

From Bruce Momjian
Subject initdb.c::main() too large
Date
Msg-id 20121130041223.GJ9501@momjian.us
Whole thread Raw
Responses Re: initdb.c::main() too large  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: initdb.c::main() too large  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
In looking to add an fsync-only option to initdb, I found its main()
function to be 743 lines long, and very hard to understand.

The attached patch moves much of that code into separate functions,
which will make initdb.c easier to understand, and easier to add an
fsync-only option.  The original initdb.c author, Andrew Dunstan, has
accepted the restructuring, in principle.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +

Attachment

pgsql-hackers by date:

Previous
From: Pavan Deolasee
Date:
Subject: Re: missing LockBuffer(buffer, BUFFER_LOCK_SHARE) in trigger.c GetTupleForTrigger?
Next
From: Tom Lane
Date:
Subject: Re: initdb.c::main() too large