[PATCH] Cleanup of GUC units code

From: Marko Kreen <markokr(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: [PATCH] Cleanup of GUC units code
Date: 2008-08-31 22:17:33
Message-ID: 20080831221732.18573.89200.stgit@lapp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Current GUC units code has 2 problems:

- It requires case-sensiteive representation of units ("kB").
As the main point of units is to make configuring easier,
requiring byte-exact typing makes them unnecessarily fragile.

- In attempt to preserve maximum range of values for INT64_IS_BUSTED
systems, the code is written rather non-obvious way.

Attached patch replaces per-unit custom code with lookup table,
where each unit is represented as multiplier of base unit.
And it compares unit names case-insensitivaly.

It sacrifices some range on INT64_IS_BUSTED systems, but as the only promise
we offer them is that "Postgres may compile" I don't see it as problem.

In case people like the case-sensitivity, it can be restored and the patch
applied as plain cleanup.

Attachment Content-Type Size
units-full-cleanup.patch text/plain 8.7 KB


Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Kreen 2008-08-31 22:17:38 [PATCH] In case module has wrong magic, report exact problem
Previous Message Marko Kreen 2008-08-31 22:17:27 [PATCH] Make gram.y use palloc/pfree for memory management