 
 ------------------------------------------------------------------------------------------------------
 -- Given a cursor into a set, process the set returning the subset matching the BYSETPOS
+--
+-- Note that this function *requires* PostgreSQL 8.3 or later for the cursor handling syntax
+-- to work.  I guess we could do it with an array, instead, for compatibility with earlier
+-- releases, since there's a maximum of 366 positions in a set.
 ------------------------------------------------------------------------------------------------------
 CREATE or REPLACE FUNCTION rrule_bysetpos_filter( REFCURSOR, INT[] ) RETURNS SETOF TIMESTAMP WITH TIME ZONE AS $$
 DECLARE


------------------------------------------------------------------------------------------------------
-- Return another week's worth of events
------------------------------------------------------------------------------------------------------
CREATE or REPLACE FUNCTION weekly_set( TIMESTAMP WITH TIME ZONE, rrule_parts ) RETURNS SETOF TIMESTAMP WITH TIME ZONE AS $$
DECLARE

    -- We don't yet implement byweekno, byblah
    RETURN NEXT after;
  END IF;

END;
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT;

