I\'m trying to write a Postgres function for a pg_featureserv API (pg_featureserv function tutorial) but cannot figure out how to set it up. The function looks like this cur