[PATCH] Cleanup of GUC units code - Mailing list pgsql-hackers

From Marko Kreen
Subject [PATCH] Cleanup of GUC units code
Date
Msg-id 20080831221732.18573.89200.stgit@lapp
Whole thread Raw
Responses Re: [PATCH] Cleanup of GUC units code
List 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

pgsql-hackers by date:

Previous
From: Marko Kreen
Date:
Subject: [PATCH] Make gram.y use palloc/pfree for memory management
Next
From: Marko Kreen
Date:
Subject: [PATCH] In case module has wrong magic, report exact problem