"Ignacio Colmenero" <ignacio.colmenero@xxxxxxxxxxx> writes: > I get the error: ERROR: control reached end of function without RETURN > What can be wrong? You don't have a RETURN statement. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq