Changes between Version 6 and Version 7 of DevWikiPostGISCoding
- Timestamp:
- 12/09/10 13:43:55 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DevWikiPostGISCoding
v6 v7 24 24 25 25 Most 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 }}} 26 36 27 37