Refactoring GUC unit conversions

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Refactoring GUC unit conversions
Date: 2015-02-13 13:26:14
Message-ID: 54DDFB76.9080303@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

In the "redesign checkpoint_segments" patch, Robert suggested keeping
the settings' base unit as "number of segments", but allow conversions
from MB, GB etc. I started looking into that and found that adding a new
unit to guc.c is quite messy. The conversions are done with complicated
if-switch-case constructs.

Attached is a patch to refactor that, making the conversions
table-driven. This doesn't change functionality, it just makes the code
nicer.

Any objections?

- Heikki

Attachment Content-Type Size
0001-Refactor-unit-conversions-code-in-guc.c.patch application/x-patch 13.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Teodor Sigaev 2015-02-13 15:20:12 anyarray
Previous Message Michael Paquier 2015-02-13 13:07:41 Re: Using 128-bit integers for sum, avg and statistics aggregates