From 11c794f2249ba6b1d890da309e26e0ddff8bc60c Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 23 Jul 2008 17:29:53 +0000 Subject: 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/utils/misc/guc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/backend/utils') diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 8b072895b1e..874d20c15f1 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -10,7 +10,7 @@ * Written by Peter Eisentraut . * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.464 2008/07/10 22:08:17 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.465 2008/07/23 17:29:53 tgl Exp $ * *-------------------------------------------------------------------- */ @@ -4115,7 +4115,7 @@ parse_bool(const char *value, bool *result) * If not okay and hintmsg is not NULL, *hintmsg is set to a suitable * HINT message, or NULL if no hint provided. */ -static bool +bool parse_int(const char *value, int *result, int flags, const char **hintmsg) { int64 val; @@ -4322,7 +4322,7 @@ parse_int(const char *value, int *result, int flags, const char **hintmsg) * If the string parses okay, return true, else false. * If okay and result is not NULL, return the value in *result. */ -static bool +bool parse_real(const char *value, double *result) { double val; -- cgit v1.2.3