diff options
| author | Neil Conway <neilc@samurai.com> | 2008-03-25 19:26:54 +0000 |
|---|---|---|
| committer | Neil Conway <neilc@samurai.com> | 2008-03-25 19:26:54 +0000 |
| commit | 1d812a98b47da94ad274dcac682c5d2c014aae16 (patch) | |
| tree | 6d4b51db76796e3dd7a59e7b18432bf179fe89ad /src/backend/utils/mmgr | |
| parent | 76cf067ae40d5f8c4bf95954726e0067131da84b (diff) | |
| download | postgresql-1d812a98b47da94ad274dcac682c5d2c014aae16.tar.gz | |
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/utils/mmgr')
| -rw-r--r-- | src/backend/utils/mmgr/portalmem.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/backend/utils/mmgr/portalmem.c b/src/backend/utils/mmgr/portalmem.c index ca5604a61d..63bf48124a 100644 --- a/src/backend/utils/mmgr/portalmem.c +++ b/src/backend/utils/mmgr/portalmem.c @@ -12,7 +12,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/mmgr/portalmem.c,v 1.106 2008/01/01 19:45:55 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mmgr/portalmem.c,v 1.107 2008/03/25 19:26:53 neilc Exp $ * *------------------------------------------------------------------------- */ @@ -911,7 +911,6 @@ pg_cursor(PG_FUNCTION_ARGS) while ((hentry = hash_seq_search(&hash_seq)) != NULL) { Portal portal = hentry->portal; - HeapTuple tuple; Datum values[6]; bool nulls[6]; @@ -935,11 +934,9 @@ pg_cursor(PG_FUNCTION_ARGS) values[4] = BoolGetDatum(portal->cursorOptions & CURSOR_OPT_SCROLL); values[5] = TimestampTzGetDatum(portal->creation_time); - 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); } /* clean up and return the tuplestore */ |
