Re: [HACKERS] Defining input function for new datatype

2011-04-21 Thread Pavel Stehule
Hello 2011/4/21 Nick Raj : > Hi, > I am defining a new data type called mpoint > i.e. > typedef struct mpoint > { >     Point p; >     Timestamp t; > } mpoint; > > For defining input/output function > > 1 Datum mpoint_in(PG_FUNCTION_ARGS) > 2 { > 3 > 4    mpoint *result; > 5    cha

[HACKERS] Defining input function for new datatype

2011-04-21 Thread Nick Raj
Hi, I am defining a new data type called mpoint i.e. typedef struct mpoint { Point p; Timestamp t; } mpoint; For defining input/output function 1 Datum mpoint_in(PG_FUNCTION_ARGS) 2 { 3 4mpoint *result; 5char *pnt=(char *)malloc (sizeof (20)); 6char *ts=(ch