postgresql/contrib/spi
Tom Lane 220db7ccd8 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, 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
2008-03-25 22:42:46 +00:00
..
autoinc.c Simplify and standardize conversions between TEXT datums and ordinary C 2008-03-25 22:42:46 +00:00
autoinc.example General function for SERIAL/IDENTITY/AUTOINCREMENT feature. 1997-10-02 18:01:57 +00:00
autoinc.sql.in Add CVS version labels to all install/uninstall scripts. 2007-11-13 04:24:29 +00:00
insert_username.c Simplify and standardize conversions between TEXT datums and ordinary C 2008-03-25 22:42:46 +00:00
insert_username.example Trigger function for inserting user names. 1997-10-17 09:55:34 +00:00
insert_username.sql.in Add CVS version labels to all install/uninstall scripts. 2007-11-13 04:24:29 +00:00
Makefile Remove obsoleted README files. 2007-12-03 04:22:54 +00:00
moddatetime.c Wording cleanup for error messages. Also change can't -> cannot. 2007-02-01 19:10:30 +00:00
moddatetime.example Remove the last traces of datatypes datetime and timespan. 2002-05-03 04:11:08 +00:00
moddatetime.sql.in Add CVS version labels to all install/uninstall scripts. 2007-11-13 04:24:29 +00:00
refint.c Make use of plancache module for SPI plans. In particular, since plpgsql 2007-03-15 23:12:07 +00:00
refint.example README for refint.c and example of using. 1997-09-12 02:41:15 +00:00
refint.sql.in Add CVS version labels to all install/uninstall scripts. 2007-11-13 04:24:29 +00:00
timetravel.c Simplify and standardize conversions between TEXT datums and ordinary C 2008-03-25 22:42:46 +00:00
timetravel.example Here is 4 file in tgz: 2003-07-27 04:51:45 +00:00
timetravel.sql.in Add CVS version labels to all install/uninstall scripts. 2007-11-13 04:24:29 +00:00