diff options
Diffstat (limited to 'contrib/postgres_fdw/option.c')
-rw-r--r-- | contrib/postgres_fdw/option.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/contrib/postgres_fdw/option.c b/contrib/postgres_fdw/option.c index 1a03e02263e..af5422d2152 100644 --- a/contrib/postgres_fdw/option.c +++ b/contrib/postgres_fdw/option.c @@ -115,15 +115,18 @@ postgres_fdw_validator(PG_FUNCTION_ARGS) else if (strcmp(def->defname, "fdw_startup_cost") == 0 || strcmp(def->defname, "fdw_tuple_cost") == 0) { - /* these must have a non-negative numeric value */ + /* + * These must have a floating point value greater than or equal to + * zero. + */ double val; char *endp; val = strtod(defGetString(def), &endp); if (*endp || val < 0) ereport(ERROR, - (errcode(ERRCODE_SYNTAX_ERROR), - errmsg("%s requires a non-negative numeric value", + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("\"%s\" must be a floating point value greater than or equal to zero", def->defname))); } else if (strcmp(def->defname, "extensions") == 0) @@ -138,8 +141,8 @@ postgres_fdw_validator(PG_FUNCTION_ARGS) fetch_size = strtol(defGetString(def), NULL, 10); if (fetch_size <= 0) ereport(ERROR, - (errcode(ERRCODE_SYNTAX_ERROR), - errmsg("%s requires a non-negative integer value", + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("\"%s\" must be an integer value greater than zero", def->defname))); } else if (strcmp(def->defname, "password_required") == 0) |