aboutsummaryrefslogtreecommitdiff
path: root/src/include/executor/executor.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-07-22 17:00:23 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-07-22 17:00:23 +0000
commit846c364dd4eab27e95ad01cf3a699aedea3ebe0c (patch)
tree6ddbdec2c12221fa1354512fe6212e7b6122ee4d /src/include/executor/executor.h
parentea382424eec3c7cbb0b3cda8f650e9b88669893a (diff)
downloadpostgresql-846c364dd4eab27e95ad01cf3a699aedea3ebe0c.tar.gz
postgresql-846c364dd4eab27e95ad01cf3a699aedea3ebe0c.zip
Change do_tup_output() to take Datum/isnull arrays instead of a char * array,
so it doesn't go through BuildTupleFromCStrings. This is more or less a wash for current uses, but will avoid inefficiency for planned changes to EXPLAIN. Robert Haas
Diffstat (limited to 'src/include/executor/executor.h')
-rw-r--r--src/include/executor/executor.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h
index ba625e8ed8c..86148ed1354 100644
--- a/src/include/executor/executor.h
+++ b/src/include/executor/executor.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/executor/executor.h,v 1.156 2009/07/18 19:15:42 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/executor/executor.h,v 1.157 2009/07/22 17:00:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -223,15 +223,13 @@ extern void UpdateChangedParamSet(PlanState *node, Bitmapset *newchg);
typedef struct TupOutputState
{
- /* use "struct" here to allow forward reference */
- struct AttInMetadata *metadata;
TupleTableSlot *slot;
DestReceiver *dest;
} TupOutputState;
extern TupOutputState *begin_tup_output_tupdesc(DestReceiver *dest,
TupleDesc tupdesc);
-extern void do_tup_output(TupOutputState *tstate, char **values);
+extern void do_tup_output(TupOutputState *tstate, Datum *values, bool *isnull);
extern void do_text_output_multiline(TupOutputState *tstate, char *text);
extern void end_tup_output(TupOutputState *tstate);
@@ -240,11 +238,14 @@ extern void end_tup_output(TupOutputState *tstate);
*
* Should only be used with a single-TEXT-attribute tupdesc.
*/
-#define do_text_output_oneline(tstate, text_to_emit) \
+#define do_text_output_oneline(tstate, str_to_emit) \
do { \
- char *values_[1]; \
- values_[0] = (text_to_emit); \
- do_tup_output(tstate, values_); \
+ Datum values_[1]; \
+ bool isnull_[1]; \
+ values_[0] = PointerGetDatum(cstring_to_text(str_to_emit)); \
+ isnull_[0] = false; \
+ do_tup_output(tstate, values_, isnull_); \
+ pfree(DatumGetPointer(values_[0])); \
} while (0)