Re: SRF written in C

From: Felipe de Jesús Molina Bravo <felipe(dot)molina(at)inegi(dot)gob(dot)mx>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: SRF written in C
Date: 2008-07-02 14:29:28
Message-ID: 1215008968.4372.15.camel@fjmb
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


El mié, 02-07-2008 a las 08:02 +0200, Martijn van Oosterhout escribió:
> On Tue, Jul 01, 2008 at 10:02:39AM -0500, Felipe de Jesús Molina Bravo wrote:
> > Hi
> >
> > what can i do for a SRF written in C, can called as follow:
> >
> > select * from obtAscendencia('(11099,15685)','(6808,9621)');
> >
> > I can call the function:
> > select obtAscendencia('(11099,15685)','(6808,9621)');
>
> I'm afraid you did not explain what exactly the problem is. Do you mean
> that one or the other of the statements doesn't work? Which one, and
> what is the error message?
>
> Have a nice day,

ok... sorry

the next statement:
select * from obtAscendencia('(11099,15685)','(6808,9621)');

never end .... i need to kill the process assigned for my statement...
and the other statement:

select obtAscendencia('(11099,15685)','(6808,9621)');

is correct ... the output is:

obtascendencia
----------------
(4291, 6064)
(1774, 2507)
(1031, 1457)
(288, 407)
(121, 171)
(75, 106)
(29, 41)
(12, 17)
(7, 10)
(2, 3)
(10 filas)

and my question is :

Why can not perform my function as the first statement?

I suspect that my error is:

r = obtPadre( &intF->izq, &intF->der );
if ( ( r->num != 1 ) &&
( r->den != 2 ) )
{

intF->der.num = intF->izq.num;
intF->der.den = intF->izq.den;
intF->izq.num = r->num;
intF->izq.den = r->den;

SRF_RETURN_NEXT(funcctx, (Datum)(r));
}

Where "r" is type "Racional" (Rational)...

thanks in advance

see you

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2008-07-02 14:35:29 Re: Postgres benchmark?
Previous Message David Siebert 2008-07-02 14:24:17 Postgres benchmark?