Skip site navigation (1) Skip section navigation (2)

Re: C function to return tuple

From: Marios Vodas <mvodas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: C function to return tuple
Date: 2010-09-26 18:36:33
Message-ID: AANLkTikWC+Q_sshvDFQ4ZeRfs+ZBgGbgr+T81kbEmBhL@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Do you think it would be better to change d_type to this?
CREATE TYPE d_type AS
(

xi double precision,
yi double precision,
xe double precision,
ye double precision,
id integer

);
*Note: This is NOT something I want to do but if there is no other way to
form d_type tuple from the variables...*

On Sun, Sep 26, 2010 at 8:29 PM, Marios Vodas <mvodas(at)gmail(dot)com> wrote:

> Suppose I had the data that form the returning tuple in 5 variables like
> this:
> float8 xi = 1;
> float8 yi = 2;
> float8 xe = 3;
> float8 ye = 4;
> int32 id = 1;
>
> In addition the function wouldn't have any input parameters. It just
> returns a tuple of type d_type.
> Can you tell me how it is possible to form the tuple? My problem here is
> that I DON'T have HeapTupleHeaders i and e  already formed (those two are
> of p_type) so I have to form them somehow.
>

In response to

pgsql-hackers by date

Next:From: Kevin GrittnerDate: 2010-09-26 18:59:57
Subject: Re: Documentation, window functions
Previous:From: Robert HaasDate: 2010-09-26 18:26:23
Subject: do we want to gitignore regression-test-failure files?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group