initdb.c::main() too large

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: initdb.c::main() too large
Date: 2012-11-30 04:12:23
Message-ID: 20121130041223.GJ9501@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

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

Attachment Content-Type Size
initdb.diff text/x-diff 21.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-11-30 04:23:59 Re: initdb.c::main() too large
Previous Message Pavan Deolasee 2012-11-30 03:22:18 Re: missing LockBuffer(buffer, BUFFER_LOCK_SHARE) in trigger.c GetTupleForTrigger?