1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

file_fdw: Improve error message

The hint looked a bit confusing when there were no valid options to
hint about.
This commit is contained in:
Peter Eisentraut
2012-05-17 20:20:33 +03:00
parent 4ad5cbedf6
commit 8402fab411
2 changed files with 7 additions and 5 deletions

View File

@ -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.")));
}
/*