--CREATE OR REPLACE FUNCTION fnx_getFullYears("dateX" timestamp, "dateY" timestamp)
--  RETURNS integer AS
--$BODY$	
--declare	_y int;
--Begin	
--	_y := date_part('year', "dateY") - date_part('year', "dateX");
--	_y := case when "dateY" < "dateX" + _y * interval '1 year' then _y - 1 else _y end;
--	return _y;
--END $BODY$
--  LANGUAGE plpgsql immutable;
--ALTER FUNCTION fnx_getFullYears(timestamp, timestamp)
--  OWNER TO postgres;