pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: eehab hamzeh <eehab40@hotmail.com>
To: pgsql-committers@postgresql.org
Date: Mon, 6 Apr 2009 12:51:01 +0000
Message-ID: <BLU133-W319D3FE0D6E866A8A2B529A0840@phx.gbl> (raw)


    Hello 

I am trying to build some functions using C language. these functions are mentioned in the postgresql documentation. 

http://www.postgresql.org/docs/8.3/interactive/xfunc-c.html

Datum
add_one_float8(PG_FUNCTION_ARGS)
{
    /* The macros for FLOAT8 hide its pass-by-reference nature. */
    float8   arg = PG_GETARG_FLOAT8(0);

    PG_RETURN_FLOAT8(arg + 1.0);
}

PG_FUNCTION_INFO_V1(makepoint);

Datum
makepoint(PG_FUNCTION_ARGS)
{
    /* Here, the pass-by-reference nature of Point is not hidden. */
    Point     *pointx = PG_GETARG_POINT_P(0);
    Point     *pointy = PG_GETARG_POINT_P(1);
    Point     *new_point = (Point *) palloc(sizeof(Point));

    new_point->x = pointx->x;
    new_point->y = pointy->y;
       
    PG_RETURN_POINT_P(new_point);
}

the only function that are work are the one with int32 variable. 
the other function bring errors and are not working
any body can give directions


kind regards
ihab

_________________________________________________________________
Show them the way! Add maps and directions to your party invites. 
http://www.microsoft.com/windows/windowslive/products/events.aspx

view thread (10+ messages)  latest in thread

Message-ID: <BLU133-W319D3FE0D6E866A8A2B529A0840@phx.gbl>
Permalink:  ../BLU133-W319D3FE0D6E866A8A2B529A0840@phx.gbl/
Also on:    postgresql.org/message-id/BLU133-W319D3FE0D6E866A8A2B529A0840@phx.gbl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: eehab40@hotmail.com
  Subject: Re: 
  In-Reply-To: <BLU133-W319D3FE0D6E866A8A2B529A0840@phx.gbl>
  References: <BLU133-W319D3FE0D6E866A8A2B529A0840@phx.gbl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox