forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit77cb4a1
committed
Standardize describe.c's behavior for no-matching-objects a bit more.
Most functions in this file are content to print an empty table if thereare no matching objects. In some, the behavior is to loop over allmatching objects and print a table for each one; therefore, without anyextra logic, nothing at all would be printed if no objects match.We accept that outcome in QUIET mode, but in normal mode it seems betterto print a helpful message. The new \dRp+ command had not gotten thatmemo; fix it.listDbRoleSettings() is out of step on this, but I think it's better forit to print a custom message rather than an empty table, because of thepossibility that the user is confused about what the pattern arguments meanor which is which. The original message wording was entirely useless forclarifying that, though, not to mention being unlike the wordings usedelsewhere. Improve the text, and also print the messages with psql_erroras is the general custom here.listTables() is also out in left field, but since it's such a heavilyused function, I'm hesitant to change its behavior so much as to printan empty table rather than a custom message. People are probably usedto getting a message. But we can make the wording more standardized andhelpful, and print it with psql_error rather than printing to stdout.In both listDbRoleSettings and listTables, we play dumb and emit anempty table, not a custom message, in QUIET mode. That was true beforeand I see no need to change it.Several of the places printing such messages risked dumping core ifno pattern string had been provided; make them more wary. (This caseis presently unreachable in describeTableDetails; but it shouldn't beassuming that command.c will never pass it a null. The text searchfunctions would only reach the case if a database contained no textsearch objects, which is also currently impossible since we pin thebuilt-in objects, but again it seems unwise to assume that here.)Daniel Gustafsson, tweaked a bit by meDiscussion:https://postgr.es/m/3641F19B-336A-431A-86CE-A80562505C5E@yesql.se1 parent1e2f941 commit77cb4a1
1 file changed
+58
-11
lines changedLines changed: 58 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1322 | 1322 |
| |
1323 | 1323 |
| |
1324 | 1324 |
| |
1325 |
| - | |
1326 |
| - | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
1327 | 1332 |
| |
1328 | 1333 |
| |
1329 | 1334 |
| |
| |||
3250 | 3255 |
| |
3251 | 3256 |
| |
3252 | 3257 |
| |
| 3258 | + | |
| 3259 | + | |
| 3260 | + | |
| 3261 | + | |
| 3262 | + | |
| 3263 | + | |
3253 | 3264 |
| |
3254 | 3265 |
| |
3255 |
| - | |
3256 |
| - | |
| 3266 | + | |
| 3267 | + | |
| 3268 | + | |
| 3269 | + | |
| 3270 | + | |
| 3271 | + | |
3257 | 3272 |
| |
3258 |
| - | |
| 3273 | + | |
3259 | 3274 |
| |
3260 | 3275 |
| |
3261 | 3276 |
| |
| |||
3414 | 3429 |
| |
3415 | 3430 |
| |
3416 | 3431 |
| |
| 3432 | + | |
| 3433 | + | |
| 3434 | + | |
| 3435 | + | |
| 3436 | + | |
3417 | 3437 |
| |
3418 | 3438 |
| |
3419 | 3439 |
| |
3420 |
| - | |
| 3440 | + | |
| 3441 | + | |
3421 | 3442 |
| |
3422 |
| - | |
| 3443 | + | |
3423 | 3444 |
| |
3424 | 3445 |
| |
3425 | 3446 |
| |
| |||
4074 | 4095 |
| |
4075 | 4096 |
| |
4076 | 4097 |
| |
4077 |
| - | |
4078 |
| - | |
| 4098 | + | |
| 4099 | + | |
| 4100 | + | |
| 4101 | + | |
| 4102 | + | |
| 4103 | + | |
| 4104 | + | |
4079 | 4105 |
| |
4080 | 4106 |
| |
4081 | 4107 |
| |
| |||
4459 | 4485 |
| |
4460 | 4486 |
| |
4461 | 4487 |
| |
4462 |
| - | |
4463 |
| - | |
| 4488 | + | |
| 4489 | + | |
| 4490 | + | |
| 4491 | + | |
| 4492 | + | |
| 4493 | + | |
| 4494 | + | |
4464 | 4495 |
| |
4465 | 4496 |
| |
4466 | 4497 |
| |
| |||
5148 | 5179 |
| |
5149 | 5180 |
| |
5150 | 5181 |
| |
| 5182 | + | |
| 5183 | + | |
| 5184 | + | |
| 5185 | + | |
| 5186 | + | |
| 5187 | + | |
| 5188 | + | |
| 5189 | + | |
| 5190 | + | |
| 5191 | + | |
| 5192 | + | |
| 5193 | + | |
| 5194 | + | |
| 5195 | + | |
| 5196 | + | |
| 5197 | + | |
5151 | 5198 |
| |
5152 | 5199 |
| |
5153 | 5200 |
| |
|
0 commit comments
Comments
(0)