forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit26aaf97
committed
Make StringInfo available to frontend code.
There's plenty places in frontend code that could benefit from astring buffer implementation. Some because it yields simpler andfaster code, and some others because of the desire to share codebetween backend and frontend.While there is a string buffer implementation available to frontendcode, libpq's PQExpBuffer, it is clunkier than stringinfo, itintroduces a libpq dependency, doesn't allow for sharing betweenfrontend and backend code, and has a higher API/ABI stabilityrequirement due to being exposed via libpq.Therefore it seems best to just making StringInfo being usable byfrontend code. There's not much to do for that, except for rewritingtwo subsequent elog/ereport calls into others types of errorreporting, and deciding on a maximum string length.For the maximum string size I decided to privately define MaxAllocSizeto the same value as used in the backend. It seems likely that we'llwant to reconsider this for both backend and frontend code in the nottoo far away future.For now I've left stringinfo.h in lib/, rather than common/, to reducethe likelihood of unnecessary breakage. We could alternatively decideto provide a redirecting stringinfo.h in lib/, or just not providecompatibility.Author: Andres FreundReviewed-By: Kyotaro Horiguchi, Daniel GustafssonDiscussion:https://postgr.es/m/20190920051857.2fhnvhvx4qdddviz@alap3.anarazel.de1 parent01368e5 commit26aaf97
File tree
7 files changed
+49
-43
lines changed- src
- backend/lib
- bin/pg_waldump
- common
- include/lib
- tools/msvc
7 files changed
+49
-43
lines changedLines changed: 0 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
26 |
| - | |
27 | 26 |
| |
28 | 27 |
|
Lines changed: 0 additions & 27 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
23 |
| - | |
24 | 23 |
| |
25 | 24 |
| |
26 | 25 |
| |
| |||
63 | 62 |
| |
64 | 63 |
| |
65 | 64 |
| |
66 |
| - | |
67 |
| - | |
68 |
| - | |
69 |
| - | |
70 |
| - | |
71 |
| - | |
72 |
| - | |
73 |
| - | |
74 |
| - | |
75 |
| - | |
76 |
| - | |
77 |
| - | |
78 |
| - | |
79 |
| - | |
80 |
| - | |
81 |
| - | |
82 |
| - | |
83 |
| - | |
84 |
| - | |
85 |
| - | |
86 |
| - | |
87 |
| - | |
88 |
| - | |
89 |
| - | |
90 |
| - | |
91 |
| - |
Lines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
514 | 514 |
| |
515 | 515 |
| |
516 | 516 |
| |
| 517 | + | |
517 | 518 |
| |
518 | 519 |
| |
519 | 520 |
| |
| |||
530 | 531 |
| |
531 | 532 |
| |
532 | 533 |
| |
533 |
| - | |
534 |
| - | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
535 | 538 |
| |
536 | 539 |
| |
537 | 540 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
67 | 67 |
| |
68 | 68 |
| |
69 | 69 |
| |
| 70 | + | |
70 | 71 |
| |
71 | 72 |
| |
72 | 73 |
| |
|
Lines changed: 38 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
5 |
| - | |
6 |
| - | |
7 |
| - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
8 | 9 |
| |
9 | 10 |
| |
10 | 11 |
| |
11 | 12 |
| |
12 |
| - | |
| 13 | + | |
13 | 14 |
| |
14 | 15 |
| |
15 | 16 |
| |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 |
| |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
17 | 31 |
| |
18 | 32 |
| |
19 |
| - | |
20 | 33 |
| |
21 | 34 |
| |
22 | 35 |
| |
| |||
261 | 274 |
| |
262 | 275 |
| |
263 | 276 |
| |
264 |
| - | |
265 |
| - | |
266 |
| - | |
267 |
| - | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
268 | 281 |
| |
269 | 282 |
| |
270 | 283 |
| |
| |||
276 | 289 |
| |
277 | 290 |
| |
278 | 291 |
| |
| 292 | + | |
| 293 | + | |
279 | 294 |
| |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
280 | 300 |
| |
| 301 | + | |
| 302 | + | |
281 | 303 |
| |
282 | 304 |
| |
283 | 305 |
| |
284 | 306 |
| |
285 | 307 |
| |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
286 | 315 |
| |
287 | 316 |
| |
288 | 317 |
| |
|
Lines changed: 4 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
6 |
| - | |
7 |
| - | |
8 |
| - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
9 | 10 |
| |
10 | 11 |
| |
11 | 12 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
123 | 123 |
| |
124 | 124 |
| |
125 | 125 |
| |
126 |
| - | |
| 126 | + | |
127 | 127 |
| |
128 | 128 |
| |
129 | 129 |
| |
|
0 commit comments
Comments
(0)