Commit 1218ca9
committed
Add to_regtypemod function to extract typemod from a string type name.
In combination with to_regtype, this allows converting a string to
the "canonicalized" form emitted by format_type. That usage requires
parsing the string twice, which is slightly annoying but not really
too expensive. We considered alternatives such as returning a record
type, but that way was notationally uglier than this, and possibly
less flexible.
Like to_regtype(), we'd rather that this return NULL for any bad
input, but the underlying type-parsing logic isn't yet capable of
not throwing syntax errors. Adjust the documentation for both
functions to point that out.
In passing, fix up a couple of nearby entries in the System Catalog
Information Functions table that had not gotten the word about our
since-v13 convention for displaying function usage examples.
David Wheeler and Erik Wienhold, reviewed by Pavel Stehule, Jim Jones,
and others.
Discussion: https://postgr.es/m/DF2324CA-2673-4ABE-B382-26B5770B6AA3@justatheory.com1 parent 8068676 commit 1218ca9
File tree
6 files changed
+115
-32
lines changed- doc/src/sgml
- src
- backend/utils/adt
- include/catalog
- test/regress
- expected
- sql
6 files changed
+115
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24872 | 24872 | | |
24873 | 24873 | | |
24874 | 24874 | | |
24875 | | - | |
| 24875 | + | |
24876 | 24876 | | |
24877 | 24877 | | |
24878 | 24878 | | |
| |||
25387 | 25387 | | |
25388 | 25388 | | |
25389 | 25389 | | |
25390 | | - | |
25391 | | - | |
25392 | | - | |
25393 | | - | |
25394 | | - | |
25395 | | - | |
25396 | | - | |
25397 | | - | |
25398 | | - | |
25399 | | - | |
25400 | | - | |
25401 | | - | |
| 25390 | + | |
| 25391 | + | |
25402 | 25392 | | |
25403 | 25393 | | |
25404 | 25394 | | |
| |||
25418 | 25408 | | |
25419 | 25409 | | |
25420 | 25410 | | |
25421 | | - | |
25422 | | - | |
25423 | | - | |
25424 | | - | |
25425 | | - | |
25426 | | - | |
25427 | | - | |
25428 | | - | |
25429 | | - | |
25430 | | - | |
25431 | | - | |
25432 | | - | |
| 25411 | + | |
| 25412 | + | |
| 25413 | + | |
| 25414 | + | |
| 25415 | + | |
| 25416 | + | |
25433 | 25417 | | |
25434 | 25418 | | |
25435 | 25419 | | |
| |||
25570 | 25554 | | |
25571 | 25555 | | |
25572 | 25556 | | |
25573 | | - | |
| 25557 | + | |
25574 | 25558 | | |
25575 | 25559 | | |
25576 | 25560 | | |
25577 | 25561 | | |
25578 | 25562 | | |
25579 | 25563 | | |
25580 | 25564 | | |
25581 | | - | |
25582 | | - | |
25583 | | - | |
25584 | | - | |
25585 | | - | |
| 25565 | + | |
| 25566 | + | |
| 25567 | + | |
| 25568 | + | |
| 25569 | + | |
| 25570 | + | |
| 25571 | + | |
| 25572 | + | |
| 25573 | + | |
| 25574 | + | |
| 25575 | + | |
| 25576 | + | |
| 25577 | + | |
| 25578 | + | |
| 25579 | + | |
| 25580 | + | |
| 25581 | + | |
| 25582 | + | |
| 25583 | + | |
| 25584 | + | |
| 25585 | + | |
| 25586 | + | |
| 25587 | + | |
| 25588 | + | |
| 25589 | + | |
| 25590 | + | |
| 25591 | + | |
| 25592 | + | |
| 25593 | + | |
| 25594 | + | |
| 25595 | + | |
| 25596 | + | |
| 25597 | + | |
| 25598 | + | |
| 25599 | + | |
| 25600 | + | |
25586 | 25601 | | |
25587 | 25602 | | |
25588 | 25603 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1220 | 1220 | | |
1221 | 1221 | | |
1222 | 1222 | | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
1223 | 1243 | | |
1224 | 1244 | | |
1225 | 1245 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7155 | 7155 | | |
7156 | 7156 | | |
7157 | 7157 | | |
| 7158 | + | |
| 7159 | + | |
| 7160 | + | |
7158 | 7161 | | |
7159 | 7162 | | |
7160 | 7163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
447 | 447 | | |
448 | 448 | | |
449 | 449 | | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
450 | 487 | | |
451 | 488 | | |
452 | 489 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
126 | 134 | | |
127 | 135 | | |
128 | 136 | | |
| |||
0 commit comments