Re: [PATCH][HOTFIX] vacuum_cost_delay type change from int to real have not been done everywhere

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Nikolay Shaplov <dhyan@nataraj.su>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, Julien Rouhaud <rjuju123@gmail.com>, Andrew Dunstan <andrew.dunstan@2ndquadrant.com>, David Rowley <david.rowley@2ndquadrant.com>, Jeff Janes <jeff.janes@gmail.com>, Jeremy Schneider <schnjere@amazon.com>, Joe Conway <mail@joeconway.com>, Peter Geoghegan <pg@bowt.ie>
Date: 2019-03-26T17:38:00Z
Lists: pgsql-hackers
Nikolay Shaplov <dhyan@nataraj.su> writes:
> In caf626b2 type of vacuum_cost_delay have been switched from int to real, 
> everywhere, but not in *RelOpts[] arrays.

Ugh.

> For some reason it continued to build and work.

I'm not quite sure why it worked either; apparently, the type of that
array entry doesn't have anything to do with the variable's storage
format.  The bounds-check code must think it's dealing with an integer,
but that doesn't matter either for the values we need.

> PS. As you can see current reloption code is error-prone.

Yeah, that was pretty obvious already :-(.  Having more than one place
defining the type of an option is clearly bogus.  I missed that this
entry was type-specific because you'd really have to go up to the top
of the array to notice that; and since the type information *is* contained
in another entry, my bogometer failed to trigger.

Fix pushed, thanks for the report!

			regards, tom lane


Commits

  1. Fix oversight in data-type change for autovacuum_vacuum_cost_delay.