mirror of
https://github.com/postgres/postgres.git
synced 2025-08-09 17:03:00 +03:00
Recommend wrappers of PG_DETOAST_DATUM_PACKED().
When commit 3e23b68dac
introduced
single-byte varlena headers, its fmgr.h changes presented
PG_GETARG_TEXT_PP() and PG_GETARG_TEXT_P() as equals. Its postgres.h
changes presented PG_DETOAST_DATUM_PACKED() and VARDATA_ANY() as the
exceptional case. Now, instead, firmly recommend PG_GETARG_TEXT_PP()
over PG_GETARG_TEXT_P(); likewise for other ...PP() macros. This shaves
cycles and invites consistency of style.
This commit is contained in:
@@ -429,10 +429,11 @@ typedef struct
|
||||
* may be compressed or moved out-of-line. However datatype-specific routines
|
||||
* are mostly content to deal with de-TOASTed values only, and of course
|
||||
* client-side routines should never see a TOASTed value. But even in a
|
||||
* de-TOASTed value, beware of touching vl_len_ directly, as its representation
|
||||
* is no longer convenient. It's recommended that code always use the VARDATA,
|
||||
* VARSIZE, and SET_VARSIZE macros instead of relying on direct mentions of
|
||||
* the struct fields. See postgres.h for details of the TOASTed form.
|
||||
* de-TOASTed value, beware of touching vl_len_ directly, as its
|
||||
* representation is no longer convenient. It's recommended that code always
|
||||
* use macros VARDATA_ANY, VARSIZE_ANY, VARSIZE_ANY_EXHDR, VARDATA, VARSIZE,
|
||||
* and SET_VARSIZE instead of relying on direct mentions of the struct fields.
|
||||
* See postgres.h for details of the TOASTed form.
|
||||
* ----------------
|
||||
*/
|
||||
struct varlena
|
||||
|
Reference in New Issue
Block a user