Changes between Version 6 and Version 7 of DevWikiPostGISCoding


Ignore:
Timestamp:
12/09/10 13:43:55 (14 years ago)
Author:
pramsey
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • DevWikiPostGISCoding

    v6 v7  
    2424
    2525Most of the PG_GETARG calls are pretty self explanatory. There's the PG_GETARG part, the part that declares the data type you are retrieving, and the argument number you are retrieving. So, PG_GETARG_INT32(0) gets the first argument as an integer.
     26{{{
     27#!c
     28 PG_FUNCTION_INFO_V1(multiply)
     29 Datum multiply(PG_FUNCTION_ARGS)
     30 {
     31   int count = PG_GETARG_INT32(0);
     32   double factor = PG_GETARG_DOUBLE(1);
     33   PG_RETURN_DOUBLE(factor * count);
     34}
     35}}}
    2636
    2737