Re: Documentation of C functions

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: Documentation of C functions
Дата
Msg-id A737B7A37273E048B164557ADEF4A58B17C60D59@ntex2010i.host.magwien.gv.at
обсуждение исходный текст
Ответ на Documentation of C functions  ("Janek Sendrowski" <janek12@web.de>)
Список pgsql-general
Janek Sendrowski wrote:
> Is there a documentation of postgresql's C functions like SET_VARSIZE for exmaple?

For things like this consult the source code.

In src/include/postgres.h you'll find:

/*
 * VARDATA, VARSIZE, and SET_VARSIZE are the recommended API for most code
 * for varlena datatypes.  Note that they only work on untoasted,
 * 4-byte-header Datums!
 *
 * Code that wants to use 1-byte-header values without detoasting should
 * use VARSIZE_ANY/VARSIZE_ANY_EXHDR/VARDATA_ANY.  The other macros here
 * should usually be used only by tuple assembly/disassembly code and
 * code that specifically wants to work with still-toasted Datums.
 *
 * WARNING: It is only safe to use VARDATA_ANY() -- typically with
 * PG_DETOAST_DATUM_PACKED() -- if you really don't care about the alignment.
 * Either because you're working with something like text where the alignment
 * doesn't matter or because you're not going to access its constituent parts
 * and just use things like memcpy on it anyways.
 */

The server side C API is not documented in the documentation, because
it is already (hopefully) well documented in the source.

Yours,
Laurenz Albe

В списке pgsql-general по дате отправления:

Предыдущее
От: Joey Quinn
Дата:
Сообщение: Re: tracking scripts...
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: tracking scripts...