forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3cc38ca
committed
Add psql \errverbose command to see last server error at full verbosity.
Often, upon getting an unexpected error in psql, one's first wish is thatthe verbosity setting had been higher; for example, to be able to see theschema-name field or the server code location info. Up to now the only wayhas been to adjust the VERBOSITY variable and repeat the failing query.That's a pain, and it doesn't work if the error isn't reproducible.This commit adds a psql feature that redisplays the most recent servererror at full verbosity, without needing to make any variable changes orre-execute the failed command. We just need to hang onto the latest errorPGresult in case the user executes \errverbose, and then apply libpq'snew PQresultVerboseErrorMessage() function to it. This will consumesome trivial amount of psql memory, but otherwise the cost when thefeature isn't used should be negligible.Alex Shulgin, reviewed by Daniel Vérité, some improvements by me1 parente3161b2 commit3cc38ca
File tree
7 files changed
+88
-17
lines changed- doc/src/sgml/ref
- src/bin/psql
7 files changed
+88
-17
lines changedLines changed: 18 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1717 | 1717 |
| |
1718 | 1718 |
| |
1719 | 1719 |
| |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
1720 | 1734 |
| |
1721 | 1735 |
| |
1722 | 1736 |
| |
| |||
3244 | 3258 |
| |
3245 | 3259 |
| |
3246 | 3260 |
| |
| 3261 | + | |
| 3262 | + | |
3247 | 3263 |
| |
3248 | 3264 |
| |
3249 | 3265 |
| |
| |||
3286 | 3302 |
| |
3287 | 3303 |
| |
3288 | 3304 |
| |
| 3305 | + | |
| 3306 | + | |
3289 | 3307 |
| |
3290 | 3308 |
| |
3291 | 3309 |
| |
|
Lines changed: 22 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
822 | 822 |
| |
823 | 823 |
| |
824 | 824 |
| |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
825 | 847 |
| |
826 | 848 |
| |
827 | 849 |
| |
|
Lines changed: 42 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
497 | 497 |
| |
498 | 498 |
| |
499 | 499 |
| |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
500 | 527 |
| |
501 | 528 |
| |
502 | 529 |
| |
| |||
548 | 575 |
| |
549 | 576 |
| |
550 | 577 |
| |
551 |
| - | |
| 578 | + | |
552 | 579 |
| |
553 | 580 |
| |
554 | 581 |
| |
| |||
590 | 617 |
| |
591 | 618 |
| |
592 | 619 |
| |
593 |
| - | |
| 620 | + | |
594 | 621 |
| |
595 | 622 |
| |
596 | 623 |
| |
| |||
1077 | 1104 |
| |
1078 | 1105 |
| |
1079 | 1106 |
| |
1080 |
| - | |
| 1107 | + | |
1081 | 1108 |
| |
1082 | 1109 |
| |
1083 | 1110 |
| |
1084 |
| - | |
| 1111 | + | |
1085 | 1112 |
| |
1086 | 1113 |
| |
1087 | 1114 |
| |
| |||
1102 | 1129 |
| |
1103 | 1130 |
| |
1104 | 1131 |
| |
1105 |
| - | |
| 1132 | + | |
1106 | 1133 |
| |
1107 | 1134 |
| |
1108 | 1135 |
| |
1109 |
| - | |
| 1136 | + | |
1110 | 1137 |
| |
1111 | 1138 |
| |
1112 | 1139 |
| |
| |||
1202 | 1229 |
| |
1203 | 1230 |
| |
1204 | 1231 |
| |
1205 |
| - | |
| 1232 | + | |
1206 | 1233 |
| |
1207 | 1234 |
| |
1208 | 1235 |
| |
| |||
1213 | 1240 |
| |
1214 | 1241 |
| |
1215 | 1242 |
| |
1216 |
| - | |
| 1243 | + | |
1217 | 1244 |
| |
1218 | 1245 |
| |
1219 | 1246 |
| |
| |||
1299 | 1326 |
| |
1300 | 1327 |
| |
1301 | 1328 |
| |
1302 |
| - | |
| 1329 | + | |
1303 | 1330 |
| |
1304 | 1331 |
| |
1305 | 1332 |
| |
| |||
1313 | 1340 |
| |
1314 | 1341 |
| |
1315 | 1342 |
| |
1316 |
| - | |
| 1343 | + | |
1317 | 1344 |
| |
1318 | 1345 |
| |
1319 | 1346 |
| |
| |||
1384 | 1411 |
| |
1385 | 1412 |
| |
1386 | 1413 |
| |
1387 |
| - | |
| 1414 | + | |
1388 | 1415 |
| |
1389 | 1416 |
| |
1390 | 1417 |
| |
1391 | 1418 |
| |
1392 | 1419 |
| |
1393 | 1420 |
| |
1394 | 1421 |
| |
1395 |
| - | |
| 1422 | + | |
1396 | 1423 |
| |
1397 | 1424 |
| |
1398 | 1425 |
| |
| |||
1415 | 1442 |
| |
1416 | 1443 |
| |
1417 | 1444 |
| |
1418 |
| - | |
| 1445 | + | |
1419 | 1446 |
| |
1420 | 1447 |
| |
1421 | 1448 |
| |
| |||
1473 | 1500 |
| |
1474 | 1501 |
| |
1475 | 1502 |
| |
1476 |
| - | |
| 1503 | + | |
1477 | 1504 |
| |
1478 | 1505 |
| |
1479 | 1506 |
| |
1480 | 1507 |
| |
1481 | 1508 |
| |
1482 | 1509 |
| |
1483 |
| - | |
| 1510 | + | |
1484 | 1511 |
| |
1485 | 1512 |
| |
1486 | 1513 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
168 | 168 |
| |
169 | 169 |
| |
170 | 170 |
| |
171 |
| - | |
| 171 | + | |
172 | 172 |
| |
173 | 173 |
| |
174 | 174 |
| |
| 175 | + | |
175 | 176 |
| |
176 | 177 |
| |
177 | 178 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
86 | 86 |
| |
87 | 87 |
| |
88 | 88 |
| |
| 89 | + | |
| 90 | + | |
89 | 91 |
| |
90 | 92 |
| |
91 | 93 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
135 | 135 |
| |
136 | 136 |
| |
137 | 137 |
| |
| 138 | + | |
138 | 139 |
| |
139 | 140 |
| |
140 | 141 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1280 | 1280 |
| |
1281 | 1281 |
| |
1282 | 1282 |
| |
1283 |
| - | |
| 1283 | + | |
1284 | 1284 |
| |
1285 | 1285 |
| |
1286 | 1286 |
| |
|
0 commit comments
Comments
(0)