- Notifications
You must be signed in to change notification settings - Fork5
Commit220db7c
committed
Simplify and standardize conversions between TEXT datums and ordinary C
strings. This patch introduces four support functions cstring_to_text,cstring_to_text_with_len, text_to_cstring, and text_to_cstring_buffer, andtwo macros CStringGetTextDatum and TextDatumGetCString. A number ofexisting macros that provided variants on these themes were removed.Most of the places that need to make such conversions now require just onefunction or macro call, in place of the multiple notational layers that usedto be needed. There are no longer any direct calls of textout or textin,and we got most of the places that were using handmade conversions viamemcpy (there may be a few still lurking, though).This commit doesn't make any serious effort to eliminate transient memoryleaks caused by detoasting toasted text objects before they reachtext_to_cstring. We changed PG_GETARG_TEXT_P to PG_GETARG_TEXT_PP in a fewplaces where it was easy, but much more could be done.Brendan Jurd and Tom Lane1 parentf948197 commit220db7c
File tree
94 files changed
+770
-1210
lines changed- contrib
- adminpack
- chkpass
- dblink
- fuzzystrmatch
- hstore
- intarray
- ltree
- pageinspect
- pgcrypto
- spi
- sslinfo
- tablefunc
- tsearch2
- uuid-ossp
- xml2
- doc/src/sgml
- src
- backend
- access
- common
- transam
- catalog
- commands
- executor
- libpq
- optimizer
- path
- util
- parser
- rewrite
- tsearch
- utils
- adt
- cache
- fmgr
- init
- misc
- mmgr
- include
- tsearch
- utils
- pl
- plperl
- plpgsql/src
- plpython
- tcl
- test/regress
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
94 files changed
+770
-1210
lines changedLines changed: 3 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
| 26 | + | |
26 | 27 |
| |
27 | 28 |
| |
28 | 29 |
| |
| |||
68 | 69 |
| |
69 | 70 |
| |
70 | 71 |
| |
71 |
| - | |
72 |
| - | |
73 |
| - | |
74 |
| - | |
75 |
| - | |
| 72 | + | |
76 | 73 |
| |
77 | 74 |
| |
78 | 75 |
| |
|
Lines changed: 9 additions & 21 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
7 |
| - | |
| 7 | + | |
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
| 20 | + | |
20 | 21 |
| |
21 | 22 |
| |
22 | 23 |
| |
| |||
124 | 125 |
| |
125 | 126 |
| |
126 | 127 |
| |
127 |
| - | |
128 |
| - | |
129 | 128 |
| |
130 |
| - | |
131 |
| - | |
132 |
| - | |
133 |
| - | |
134 |
| - | |
135 |
| - | |
| 129 | + | |
136 | 130 |
| |
137 | 131 |
| |
138 | 132 |
| |
| |||
145 | 139 |
| |
146 | 140 |
| |
147 | 141 |
| |
148 |
| - | |
149 |
| - | |
150 |
| - | |
| 142 | + | |
| 143 | + | |
151 | 144 |
| |
152 |
| - | |
153 |
| - | |
154 |
| - | |
| 145 | + | |
155 | 146 |
| |
156 | 147 |
| |
157 | 148 |
| |
| |||
160 | 151 |
| |
161 | 152 |
| |
162 | 153 |
| |
163 |
| - | |
164 |
| - | |
165 |
| - | |
| 154 | + | |
| 155 | + | |
166 | 156 |
| |
167 |
| - | |
168 |
| - | |
169 |
| - | |
| 157 | + | |
170 | 158 |
| |
171 | 159 |
|
0 commit comments
Comments
(0)