Re: Refactoring GUC unit conversions

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Refactoring GUC unit conversions
Date: 2015-02-13 17:34:36
Message-ID: 54DE35AC.3080600@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2/13/15 7:26 AM, Heikki Linnakangas wrote:
> 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.

Looks good, but shouldn't there be a check for a unit that's neither
memory or time?
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2015-02-13 17:43:14 Re: Redesigning checkpoint_segments
Previous Message Teodor Sigaev 2015-02-13 16:17:02 Re: compress method for spgist - 2