Re: Re: Cstring vs. Datum values ( BuildTupleFromCStrings vs. BlessTupleDesc) - Mailing list pgsql-hackers

From Ivan Sergio Borgonovo
Subject Re: Re: Cstring vs. Datum values ( BuildTupleFromCStrings vs. BlessTupleDesc)
Date
Msg-id 20100123185330.5a190116@dawn.webthatworks.it
Whole thread Raw
In response to Re: Cstring vs. Datum values ( BuildTupleFromCStrings vs. BlessTupleDesc)  (Greg Stark <gsstark@mit.edu>)
Responses Re: Cstring vs. Datum values ( BuildTupleFromCStrings vs. BlessTupleDesc)  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers
On Sat, 23 Jan 2010 15:54:04 +0000
Greg Stark <gsstark@mit.edu> wrote:

> On Sat, Jan 23, 2010 at 12:56 PM, Ivan Sergio Borgonovo
> <mail@webthatworks.it> wrote:
> > And if I can... how, why and when... because I didn't find any
> > clear example in the source tree that gives me a clue about when
> > I'd use one form or the other.
> >
> 
> There are a few contrib modules which make good examples, you could
> look at  contrib/pageinspect/heapfuncs.c:heap_page_items() for
> example.

That confused me further since it seems a 3rd technique to return
set of records.

One way is given for example in:
./src/backend/utils/adt/tsvector_op.c
that uses BlessTupleDesc
another that seems to be more frequent is given in the docs:
http://www.postgresql.org/docs/8.4/static/xfunc-c.html#AEN44970
and finally the one you gave as an example

I can't understand when each one should be used and I can't
understand why so many ways to return a tuple... not to mention I've
to "reverse engineer" many of the parameters of the function
involved.

Could someone give me a clue about when it is more suitable to use
all the above techniques?

thanks

-- 
Ivan Sergio Borgonovo
http://www.webthatworks.it



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: tab completion for prepared transactions?
Next
From: Greg Stark
Date:
Subject: Re: Cstring vs. Datum values ( BuildTupleFromCStrings vs. BlessTupleDesc)