forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd2d3547
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 parent836af97 commitd2d3547
File tree
11 files changed
+1796
-217
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
+1796
-217
lines changedLines changed: 15 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3641 | 3641 |
| |
3642 | 3642 |
| |
3643 | 3643 |
| |
3644 |
| - | |
| 3644 | + | |
3645 | 3645 |
| |
3646 | 3646 |
| |
3647 | 3647 |
| |
3648 | 3648 |
| |
3649 | 3649 |
| |
3650 | 3650 |
| |
3651 |
| - | |
| 3651 | + | |
| 3652 | + | |
| 3653 | + | |
| 3654 | + | |
| 3655 | + | |
| 3656 | + | |
| 3657 | + | |
| 3658 | + | |
| 3659 | + | |
| 3660 | + | |
| 3661 | + | |
| 3662 | + | |
| 3663 | + | |
| 3664 | + | |
3652 | 3665 |
| |
3653 | 3666 |
| |
3654 | 3667 |
| |
|
Lines changed: 24 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1308 | 1308 |
| |
1309 | 1309 |
| |
1310 | 1310 |
| |
| 1311 | + | |
1311 | 1312 |
| |
1312 | 1313 |
| |
1313 | 1314 |
| |
1314 |
| - | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
1315 | 1322 |
| |
1316 | 1323 |
| |
1317 | 1324 |
| |
| |||
1332 | 1339 |
| |
1333 | 1340 |
| |
1334 | 1341 |
| |
| 1342 | + | |
1335 | 1343 |
| |
1336 | 1344 |
| |
1337 | 1345 |
| |
1338 | 1346 |
| |
1339 | 1347 |
| |
1340 |
| - | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
1341 | 1355 |
| |
1342 | 1356 |
| |
1343 | 1357 |
| |
| |||
1369 | 1383 |
| |
1370 | 1384 |
| |
1371 | 1385 |
| |
| 1386 | + | |
1372 | 1387 |
| |
1373 | 1388 |
| |
1374 | 1389 |
| |
1375 | 1390 |
| |
1376 | 1391 |
| |
1377 | 1392 |
| |
1378 |
| - | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
1379 | 1400 |
| |
1380 | 1401 |
| |
1381 | 1402 |
| |
|
Lines changed: 94 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
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: 61 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
178 | 178 |
| |
179 | 179 |
| |
180 | 180 |
| |
| 181 | + | |
| 182 | + | |
| 183 | + | |
181 | 184 |
| |
182 | 185 |
| |
183 | 186 |
| |
| |||
1315 | 1318 |
| |
1316 | 1319 |
| |
1317 | 1320 |
| |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
1318 | 1324 |
| |
1319 | 1325 |
| |
| 1326 | + | |
1320 | 1327 |
| |
1321 |
| - | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
1322 | 1336 |
| |
1323 | 1337 |
| |
1324 | 1338 |
| |
| |||
1362 | 1376 |
| |
1363 | 1377 |
| |
1364 | 1378 |
| |
| 1379 | + | |
| 1380 | + | |
1365 | 1381 |
| |
1366 | 1382 |
| |
1367 | 1383 |
| |
1368 |
| - | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
1369 | 1389 |
| |
1370 | 1390 |
| |
1371 | 1391 |
| |
| |||
1409 | 1429 |
| |
1410 | 1430 |
| |
1411 | 1431 |
| |
| 1432 | + | |
| 1433 | + | |
1412 | 1434 |
| |
1413 | 1435 |
| |
1414 | 1436 |
| |
1415 |
| - | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
1416 | 1442 |
| |
1417 | 1443 |
| |
1418 | 1444 |
| |
| |||
1455 | 1481 |
| |
1456 | 1482 |
| |
1457 | 1483 |
| |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
1458 | 1487 |
| |
1459 | 1488 |
| |
1460 | 1489 |
| |
| |||
1470 | 1499 |
| |
1471 | 1500 |
| |
1472 | 1501 |
| |
| 1502 | + | |
1473 | 1503 |
| |
1474 | 1504 |
| |
1475 |
| - | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
1476 | 1513 |
| |
1477 | 1514 |
| |
1478 | 1515 |
| |
| |||
1493 | 1530 |
| |
1494 | 1531 |
| |
1495 | 1532 |
| |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
1496 | 1553 |
| |
1497 | 1554 |
| |
1498 | 1555 |
| |
|
Lines changed: 12 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1269 | 1269 |
| |
1270 | 1270 |
| |
1271 | 1271 |
| |
| 1272 | + | |
| 1273 | + | |
1272 | 1274 |
| |
1273 | 1275 |
| |
1274 | 1276 |
| |
1275 |
| - | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
1276 | 1287 |
| |
1277 | 1288 |
| |
1278 | 1289 |
| |
|
0 commit comments
Comments
(0)