| From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
|---|---|
| To: | Bruce Momjian <bruce(at)momjian(dot)us> |
| Cc: | PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org> |
| Subject: | Re: initdb.c::main() too large |
| Date: | 2012-11-30 23:06:39 |
| Message-ID: | 50B93BFF.5010800@dunslane.net |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On 11/30/2012 04:45 PM, Bruce Momjian wrote:
> On Thu, Nov 29, 2012 at 11:12:23PM -0500, Bruce Momjian wrote:
>> 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.
> Applied.
>
Sorry I didn't have time to review this before it was applied.
A few minor nitpicks:
* process() is a fairly uninformative function name, not sure what I'd
call it, but something more descriptive.
* the setup_signals_and_umask() call and possibly the final message
section of process() would be better placed back in main() IMNSHO.
* the large statements for setting up the datadir and the xlogdir
should be factored out of process() into their own functions, I
think. That would make it much more readable.
cheers
andrew
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Bruce Momjian | 2012-11-30 23:09:25 | Re: initdb.c::main() too large |
| Previous Message | Kohei KaiGai | 2012-11-30 22:07:23 | Re: ALTER command reworks |