From: eehab hamzeh <eehab40(at)hotmail(dot)com>
To: <pgsql-committers(at)postgresql(dot)org>
Subject:
Date: 2009-04-06 12:51:01
Message-ID: BLU133-W319D3FE0D6E866A8A2B529A0840@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-general


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

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Emanuel Calvo Franco 2009-04-06 13:07:21 Re: [COMMITTERS]
Previous Message Heikki Linnakangas 2009-04-06 08:42:54 pgsql: Rename the new CREATE DATABASE options to set collation and ctype

Browse pgsql-general by date

  From Date Subject
Next Message danpop 2009-04-06 13:02:38 PostgreSQL data modeling tool
Previous Message Chris Spotts 2009-04-06 11:16:41 Re: copy from with trigger