aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/prepare.c
diff options
context:
space:
mode:
authorNeil Conway <neilc@samurai.com>2008-03-25 19:26:54 +0000
committerNeil Conway <neilc@samurai.com>2008-03-25 19:26:54 +0000
commit1d812a98b47da94ad274dcac682c5d2c014aae16 (patch)
tree6d4b51db76796e3dd7a59e7b18432bf179fe89ad /src/backend/commands/prepare.c
parent76cf067ae40d5f8c4bf95954726e0067131da84b (diff)
downloadpostgresql-1d812a98b47da94ad274dcac682c5d2c014aae16.tar.gz
postgresql-1d812a98b47da94ad274dcac682c5d2c014aae16.zip
Add a new tuplestore API function, tuplestore_putvalues(). This is
identical to tuplestore_puttuple(), except it operates on arrays of Datums + nulls rather than a fully-formed HeapTuple. In several places that use the tuplestore API, this means we can avoid creating a HeapTuple altogether, saving a copy.
Diffstat (limited to 'src/backend/commands/prepare.c')
-rw-r--r--src/backend/commands/prepare.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/backend/commands/prepare.c b/src/backend/commands/prepare.c
index 2199e109d46..9db486581ed 100644
--- a/src/backend/commands/prepare.c
+++ b/src/backend/commands/prepare.c
@@ -10,7 +10,7 @@
* Copyright (c) 2002-2008, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.80 2008/01/01 19:45:49 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.81 2008/03/25 19:26:53 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@@ -764,7 +764,6 @@ pg_prepared_statement(PG_FUNCTION_ARGS)
hash_seq_init(&hash_seq, prepared_queries);
while ((prep_stmt = hash_seq_search(&hash_seq)) != NULL)
{
- HeapTuple tuple;
Datum values[5];
bool nulls[5];
@@ -787,11 +786,9 @@ pg_prepared_statement(PG_FUNCTION_ARGS)
prep_stmt->plansource->num_params);
values[4] = BoolGetDatum(prep_stmt->from_sql);
- tuple = heap_form_tuple(tupdesc, values, nulls);
-
/* switch to appropriate context while storing the tuple */
MemoryContextSwitchTo(per_query_ctx);
- tuplestore_puttuple(tupstore, tuple);
+ tuplestore_putvalues(tupstore, tupdesc, values, nulls);
}
}