diff options
| author | Peter Eisentraut | 2012-05-17 17:20:33 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2012-05-17 17:20:33 +0000 |
| commit | 8402fab4112144a039157583b7e3368b8e31db3a (patch) | |
| tree | 39cb4314b38b7030c17dbc4b14c3fdd40b25d9d1 /contrib/file_fdw/file_fdw.c | |
| parent | 4ad5cbedf6ea3186a286c61a164703b107f6a138 (diff) | |
file_fdw: Improve error message
The hint looked a bit confusing when there were no valid options to
hint about.
Diffstat (limited to 'contrib/file_fdw/file_fdw.c')
| -rw-r--r-- | contrib/file_fdw/file_fdw.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/file_fdw/file_fdw.c b/contrib/file_fdw/file_fdw.c index 9ada736a48c..66fd0e62cc8 100644 --- a/contrib/file_fdw/file_fdw.c +++ b/contrib/file_fdw/file_fdw.c @@ -230,8 +230,10 @@ file_fdw_validator(PG_FUNCTION_ARGS) ereport(ERROR, (errcode(ERRCODE_FDW_INVALID_OPTION_NAME), errmsg("invalid option \"%s\"", def->defname), - errhint("Valid options in this context are: %s", - buf.data))); + buf.len > 0 + ? errhint("Valid options in this context are: %s", + buf.data) + : errhint("There are no valid options in this context."))); } /* |
