ERROR: ROWS must be positive
From the documentation about CREATE FUNCTION:


  result_rows
  A positive number giving the estimated number of rows that the planner should expect the function to return. This is only allowed when the function is declared to return a set. The default assumption is 1000 rows."


ROWS 0 is not allowed even in those functions (should be positive).

Since the function is not returning a set, you need to remove that ROWS n.