Use guc.c's parse_int() instead of pg_atoi() to parse fillfactor in
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 23 Jul 2008 17:29:53 +0000 (17:29 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 23 Jul 2008 17:29:53 +0000 (17:29 +0000)
commit3364c4afafb21d2e6cb4b77256984aad2481c9a4
tree5bc42290c68f73c5299682adcdc64836eadd0271
parentc8b0d53c711e9ee094f2ba8b04d542021682b1b7
Use guc.c's parse_int() instead of pg_atoi() to parse fillfactor in
default_reloptions().  The previous coding was really a bug because pg_atoi()
will always throw elog on bad input data, whereas default_reloptions is not
supposed to complain about bad input unless its validate parameter is true.
Right now you could only expose the problem by hand-modifying
pg_class.reloptions into an invalid state, so it doesn't seem worth
back-patching; but we should get it right in HEAD because there might be other
situations in future.  Noted while studying GIN fast-update patch.
src/backend/access/common/reloptions.c
src/backend/utils/misc/guc.c
src/include/utils/guc.h