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/include/utils/guc.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/include/utils/guc.h') diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h index c6e42ef520..87c383e1eb 100644 --- a/src/include/utils/guc.h +++ b/src/include/utils/guc.h @@ -7,7 +7,7 @@ * Copyright (c) 2000-2008, PostgreSQL Global Development Group * Written by Peter Eisentraut . * - * $PostgreSQL: pgsql/src/include/utils/guc.h,v 1.97 2008/06/30 22:10:43 momjian Exp $ + * $PostgreSQL: pgsql/src/include/utils/guc.h,v 1.98 2008/07/23 17:29:53 tgl Exp $ *-------------------------------------------------------------------- */ #ifndef GUC_H @@ -224,6 +224,9 @@ extern void AtEOXact_GUC(bool isCommit, int nestLevel); extern void BeginReportingGUCOptions(void); extern void ParseLongOption(const char *string, char **name, char **value); extern bool parse_bool(const char *value, bool *result); +extern bool parse_int(const char *value, int *result, int flags, + const char **hintmsg); +extern bool parse_real(const char *value, double *result); extern bool set_config_option(const char *name, const char *value, GucContext context, GucSource source, GucAction action, bool changeVal); -- cgit v1.2.1