forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5fedf74
committed
Improve HINT message that FDW reports when there are no valid options.
The foreign data wrapper's validator function provides a HINT message withlist of valid options for the object specified in CREATE or ALTER command,when the option given in the command is invalid. Previouslypostgresql_fdw_validator() and the validator functions for postgres_fdw anddblink_fdw worked in that way even there were no valid options in the object,which could lead to the HINT message with empty list (because there wereno valid options). For example, ALTER FOREIGN DATA WRAPPER postgres_fdwOPTIONS (format 'csv') reported the following ERROR and HINT messages.This behavior was confusing. ERROR: invalid option "format" HINT: Valid options in this context are:There is no such issue in file_fdw. The validator function for file_fdwreports the HINT message "There are no valid options in this context."instead in that case.This commit improves postgresql_fdw_validator() and the validator functionsfor postgres_fdw and dblink_fdw so that they do likewise. For example,this change causes the above ALTER FOREIGN DATA WRAPPER command toreport the following messages. ERROR: invalid option "nonexistent" HINT: There are no valid options in this context.Author: Kosei MasumuraReviewed-by: Bharath Rupireddy, Fujii MasaoDiscussion:https://postgr.es/m/557d06cebe19081bfcc83ee2affc98d3@oss.nttdata.com1 parente63ce9e commit5fedf74
File tree
9 files changed
+33
-8
lines changed- contrib
- dblink
- expected
- sql
- postgres_fdw
- expected
- sql
- src
- backend/foreign
- test/regress
- expected
- sql
9 files changed
+33
-8
lines changedLines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2054 | 2054 |
| |
2055 | 2055 |
| |
2056 | 2056 |
| |
2057 |
| - | |
2058 |
| - | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
2059 | 2061 |
| |
2060 | 2062 |
| |
2061 | 2063 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
917 | 917 |
| |
918 | 918 |
| |
919 | 919 |
| |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
920 | 924 |
| |
921 | 925 |
| |
922 | 926 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
463 | 463 |
| |
464 | 464 |
| |
465 | 465 |
| |
| 466 | + | |
| 467 | + | |
| 468 | + | |
466 | 469 |
| |
467 | 470 |
| |
468 | 471 |
| |
|
Lines changed: 5 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10746 | 10746 |
| |
10747 | 10747 |
| |
10748 | 10748 |
| |
10749 |
| - | |
| 10749 | + | |
10750 | 10750 |
| |
10751 | 10751 |
| |
10752 | 10752 |
| |
| |||
10764 | 10764 |
| |
10765 | 10765 |
| |
10766 | 10766 |
| |
| 10767 | + | |
| 10768 | + | |
| 10769 | + | |
| 10770 | + |
Lines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
107 | 107 |
| |
108 | 108 |
| |
109 | 109 |
| |
110 |
| - | |
111 |
| - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
112 | 114 |
| |
113 | 115 |
| |
114 | 116 |
| |
|
Lines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3409 | 3409 |
| |
3410 | 3410 |
| |
3411 | 3411 |
| |
3412 |
| - | |
| 3412 | + | |
3413 | 3413 |
| |
3414 | 3414 |
| |
3415 | 3415 |
| |
| |||
3423 | 3423 |
| |
3424 | 3424 |
| |
3425 | 3425 |
| |
| 3426 | + | |
| 3427 | + | |
| 3428 | + |
Lines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
670 | 670 |
| |
671 | 671 |
| |
672 | 672 |
| |
673 |
| - | |
674 |
| - | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
675 | 677 |
| |
676 | 678 |
| |
677 | 679 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
100 | 100 |
| |
101 | 101 |
| |
102 | 102 |
| |
| 103 | + | |
| 104 | + | |
| 105 | + | |
103 | 106 |
| |
104 | 107 |
| |
105 | 108 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
59 | 59 |
| |
60 | 60 |
| |
61 | 61 |
| |
| 62 | + | |
| 63 | + | |
62 | 64 |
| |
63 | 65 |
| |
64 | 66 |
| |
|
0 commit comments
Comments
(0)