diff options
| author | Tom Lane | 2007-09-21 22:52:52 +0000 |
|---|---|---|
| committer | Tom Lane | 2007-09-21 22:52:52 +0000 |
| commit | 7583f9a7cab95e067581606d86b4962525fa81f5 (patch) | |
| tree | 2fa2bfbd6c1c97c89b224a0a2c03d46745b538b0 /src/include/fmgr.h | |
| parent | cc59049daf78c3d351c1ec78fb319b5fdeb20d53 (diff) | |
Fix regex, LIKE, and some other second-rank text-manipulation functions
to not cause needless copying of text datums that have 1-byte headers.
Greg Stark, in response to performance gripe from Guillaume Smet and
ITAGAKI Takahiro.
Diffstat (limited to 'src/include/fmgr.h')
| -rw-r--r-- | src/include/fmgr.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/include/fmgr.h b/src/include/fmgr.h index 4d246ab81d..d436ba1be0 100644 --- a/src/include/fmgr.h +++ b/src/include/fmgr.h @@ -11,7 +11,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/fmgr.h,v 1.52 2007/07/25 12:22:52 mha Exp $ + * $PostgreSQL: pgsql/src/include/fmgr.h,v 1.53 2007/09/21 22:52:52 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -220,6 +220,8 @@ extern struct varlena *pg_detoast_datum_packed(struct varlena * datum); #define PG_GETARG_RAW_VARLENA_P(n) ((struct varlena *) PG_GETARG_POINTER(n)) /* use this if you want the input datum de-toasted: */ #define PG_GETARG_VARLENA_P(n) PG_DETOAST_DATUM(PG_GETARG_DATUM(n)) +/* and this if you can handle 1-byte-header datums: */ +#define PG_GETARG_VARLENA_PP(n) PG_DETOAST_DATUM_PACKED(PG_GETARG_DATUM(n)) /* DatumGetFoo macros for varlena types will typically look like this: */ #define DatumGetByteaP(X) ((bytea *) PG_DETOAST_DATUM(X)) #define DatumGetByteaPP(X) ((bytea *) PG_DETOAST_DATUM_PACKED(X)) |
