forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1185c78
committed
Add new flag to format_type_extended() to get NULL for undefined type
If a type scanned is undefined, type format routines have two behaviorsdepending on if FORMAT_TYPE_ALLOW_INVALID is used by the caller or not:- Issue a cache lookup error- Return an undefined type name "???", "???[]" or "-"The current interface is not really helpful for callers willing toformat properly a type name, but still make sure that the type isdefined as there could be types matching the strings generated whenlooking for an undefined type, even if that should not be a problem inpractice. In order to counter that, add a new flag calledFORMAT_TYPE_INVALID_AS_NULL that returns a NULL result instead of "???or "-" which does not generate an error. This flag will be used in afollow-up patch improving the set of SQL functions showing informationfor object addresses when it comes to undefined objects.Author: Michael PaquierReviewed-by: Aleksander Alekseev, Dmitry Dolgov, Daniel Gustafsson,Álvaro HerreraDiscussion:https://postgr.es/m/CAB7nPqSZxrSmdHK-rny7z8mi=EAFXJ5J-0RbzDw6aus=wB5azQ@mail.gmail.com1 parent231ef5b commit1185c78
2 files changed
+18
-5
lines changedLines changed: 17 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
96 | 96 |
| |
97 | 97 |
| |
98 | 98 |
| |
| 99 | + | |
| 100 | + | |
| 101 | + | |
99 | 102 |
| |
100 | 103 |
| |
101 | 104 |
| |
102 | 105 |
| |
103 | 106 |
| |
104 | 107 |
| |
105 |
| - | |
| 108 | + | |
106 | 109 |
| |
107 | 110 |
| |
108 | 111 |
| |
| |||
114 | 117 |
| |
115 | 118 |
| |
116 | 119 |
| |
117 |
| - | |
118 |
| - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
119 | 127 |
| |
120 | 128 |
| |
121 | 129 |
| |
122 | 130 |
| |
123 |
| - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
124 | 134 |
| |
125 | 135 |
| |
126 | 136 |
| |
| |||
144 | 154 |
| |
145 | 155 |
| |
146 | 156 |
| |
147 |
| - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
148 | 160 |
| |
149 | 161 |
| |
150 | 162 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
113 | 113 |
| |
114 | 114 |
| |
115 | 115 |
| |
| 116 | + | |
116 | 117 |
| |
117 | 118 |
| |
118 | 119 |
| |
|
0 commit comments
Comments
(0)