Re: strange tuple from ExecutorRun

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: strange tuple from ExecutorRun
Date: 2007-11-16 16:22:23
Message-ID: 13367.1195230143@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

[ not directly related to your bug, but... ]

"Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com> writes:
> result = ExecutorRun(qdesc, ForwardScanDirection, 1L);

> tuple = ExecMaterializeSlot(result);

> values = (Datum *) palloc(nargs * sizeof(Datum));
> nulls = (char *) palloc(nargs * sizeof(char));

> /* copy typle to current context */
> tuple = heap_copytuple(tuple);

> heap_deform_tuple(tuple, qdesc->tupDesc, values, nulls);

Surely that's the hard way, considering that the output tupleslot is
probably *already* a values/nulls array. Use slot_getattr(), or call
slot_getallattrs() and then reference the slot's arrays directly.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-11-16 16:30:13 Re: AllocSetStats uses fprintf instead of elog
Previous Message Sam Mason 2007-11-16 16:19:22 Re: Javascript support in the backend, i.e. PL/JS