- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit4a66300
committed
Allow db.schema.table patterns, but complain about random garbage.
psql, pg_dump, and pg_amcheck share code to process object namepatterns like 'foo*.bar*' to match all tables with names starting in'bar' that are in schemas starting with 'foo'. Before v14, any numberof extra name parts were silently ignored, so a command line '\dfoo.bar.baz.bletch.quux' was interpreted as '\d bletch.quux'. In v14,as a result of commit2c8726c, weinstead treated this as a request for table quux in a schema named'foo.bar.baz.bletch'. That caused problems for people like JustinPryzby who were accustomed to copying strings of the formdb.schema.table from messages generated by PostgreSQL itself and usingthem as arguments to \d.Accordingly, revise things so that if an object name pattern containsmore parts than we're expecting, we throw an error, unless there'sexactly one extra part and it matches the current database name.That way, thisdb.myschema.mytable is accepted as meaning justmyschema.mytable, but otherdb.myschema.mytable is an error, and sois some.random.garbage.myschema.mytable.Mark Dilger, per report from Justin Pryzby and discussion amongvarious people.Discussion:https://www.postgresql.org/message-id/20211013165426.GD27491%40telsasoft.com1 parent7891a0d commit4a66300
File tree
11 files changed
+1799
-219
lines changed- doc/src/sgml/ref
- src
- bin
- pg_amcheck
- t
- pg_dump
- t
- psql
- fe_utils
- include/fe_utils
- test/regress
- expected
- sql
11 files changed
+1799
-219
lines changedLines changed: 15 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3595 | 3595 |
| |
3596 | 3596 |
| |
3597 | 3597 |
| |
3598 |
| - | |
| 3598 | + | |
3599 | 3599 |
| |
3600 | 3600 |
| |
3601 | 3601 |
| |
3602 | 3602 |
| |
3603 | 3603 |
| |
3604 | 3604 |
| |
3605 |
| - | |
| 3605 | + | |
| 3606 | + | |
| 3607 | + | |
| 3608 | + | |
| 3609 | + | |
| 3610 | + | |
| 3611 | + | |
| 3612 | + | |
| 3613 | + | |
| 3614 | + | |
| 3615 | + | |
| 3616 | + | |
| 3617 | + | |
| 3618 | + | |
3606 | 3619 |
| |
3607 | 3620 |
| |
3608 | 3621 |
| |
|
Lines changed: 24 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1341 | 1341 |
| |
1342 | 1342 |
| |
1343 | 1343 |
| |
| 1344 | + | |
1344 | 1345 |
| |
1345 | 1346 |
| |
1346 | 1347 |
| |
1347 |
| - | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
1348 | 1355 |
| |
1349 | 1356 |
| |
1350 | 1357 |
| |
| |||
1365 | 1372 |
| |
1366 | 1373 |
| |
1367 | 1374 |
| |
| 1375 | + | |
1368 | 1376 |
| |
1369 | 1377 |
| |
1370 | 1378 |
| |
1371 | 1379 |
| |
1372 | 1380 |
| |
1373 |
| - | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
1374 | 1388 |
| |
1375 | 1389 |
| |
1376 | 1390 |
| |
| |||
1402 | 1416 |
| |
1403 | 1417 |
| |
1404 | 1418 |
| |
| 1419 | + | |
1405 | 1420 |
| |
1406 | 1421 |
| |
1407 | 1422 |
| |
1408 | 1423 |
| |
1409 | 1424 |
| |
1410 | 1425 |
| |
1411 |
| - | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
1412 | 1433 |
| |
1413 | 1434 |
| |
1414 | 1435 |
| |
|
Lines changed: 95 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 |
| - | |
| 9 | + | |
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
| |||
147 | 147 |
| |
148 | 148 |
| |
149 | 149 |
| |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
150 | 244 |
| |
151 | 245 |
| |
152 | 246 |
| |
| |||
165 | 259 |
| |
166 | 260 |
| |
167 | 261 |
| |
168 |
| - | |
169 | 262 |
| |
170 |
| - | |
171 | 263 |
| |
172 | 264 |
| |
173 | 265 |
| |
| |||
186 | 278 |
| |
187 | 279 |
| |
188 | 280 |
| |
189 |
| - | |
190 | 281 |
| |
191 |
| - | |
192 | 282 |
| |
193 | 283 |
| |
194 | 284 |
| |
195 | 285 |
| |
196 | 286 |
| |
197 |
| - | |
198 | 287 |
| |
199 | 288 |
| |
200 | 289 |
| |
|
Lines changed: 60 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
164 | 164 |
| |
165 | 165 |
| |
166 | 166 |
| |
| 167 | + | |
| 168 | + | |
| 169 | + | |
167 | 170 |
| |
168 | 171 |
| |
169 | 172 |
| |
| |||
1358 | 1361 |
| |
1359 | 1362 |
| |
1360 | 1363 |
| |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
1361 | 1367 |
| |
1362 | 1368 |
| |
| 1369 | + | |
1363 | 1370 |
| |
1364 |
| - | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
1365 | 1379 |
| |
1366 | 1380 |
| |
1367 | 1381 |
| |
| |||
1405 | 1419 |
| |
1406 | 1420 |
| |
1407 | 1421 |
| |
| 1422 | + | |
| 1423 | + | |
1408 | 1424 |
| |
1409 | 1425 |
| |
1410 | 1426 |
| |
1411 |
| - | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
1412 | 1432 |
| |
1413 | 1433 |
| |
1414 | 1434 |
| |
| |||
1452 | 1472 |
| |
1453 | 1473 |
| |
1454 | 1474 |
| |
| 1475 | + | |
| 1476 | + | |
1455 | 1477 |
| |
1456 | 1478 |
| |
1457 | 1479 |
| |
1458 |
| - | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
1459 | 1485 |
| |
1460 | 1486 |
| |
1461 | 1487 |
| |
| |||
1498 | 1524 |
| |
1499 | 1525 |
| |
1500 | 1526 |
| |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
1501 | 1530 |
| |
1502 | 1531 |
| |
1503 | 1532 |
| |
| |||
1513 | 1542 |
| |
1514 | 1543 |
| |
1515 | 1544 |
| |
| 1545 | + | |
1516 | 1546 |
| |
1517 | 1547 |
| |
1518 |
| - | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
1519 | 1556 |
| |
1520 | 1557 |
| |
1521 | 1558 |
| |
| |||
1536 | 1573 |
| |
1537 | 1574 |
| |
1538 | 1575 |
| |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
1539 | 1595 |
| |
1540 | 1596 |
| |
1541 | 1597 |
| |
|
Lines changed: 12 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1438 | 1438 |
| |
1439 | 1439 |
| |
1440 | 1440 |
| |
| 1441 | + | |
| 1442 | + | |
1441 | 1443 |
| |
1442 | 1444 |
| |
1443 | 1445 |
| |
1444 |
| - | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
1445 | 1456 |
| |
1446 | 1457 |
| |
1447 | 1458 |
| |
|
0 commit comments
Comments
(0)