mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
220db7ccd8
strings. This patch introduces four support functions cstring_to_text, cstring_to_text_with_len, text_to_cstring, and text_to_cstring_buffer, and two macros CStringGetTextDatum and TextDatumGetCString. A number of existing macros that provided variants on these themes were removed. Most of the places that need to make such conversions now require just one function or macro call, in place of the multiple notational layers that used to 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 via memcpy (there may be a few still lurking, though). This commit doesn't make any serious effort to eliminate transient memory leaks caused by detoasting toasted text objects before they reach text_to_cstring. We changed PG_GETARG_TEXT_P to PG_GETARG_TEXT_PP in a few places where it was easy, but much more could be done. Brendan Jurd and Tom Lane |
||
---|---|---|
.. | ||
autoinc.c | ||
autoinc.example | ||
autoinc.sql.in | ||
insert_username.c | ||
insert_username.example | ||
insert_username.sql.in | ||
Makefile | ||
moddatetime.c | ||
moddatetime.example | ||
moddatetime.sql.in | ||
refint.c | ||
refint.example | ||
refint.sql.in | ||
timetravel.c | ||
timetravel.example | ||
timetravel.sql.in |