... oh, one slightly more important nit-pick: per the catalogs and code, the function is factorial(bigint):
Schema | Name | Result data type | Argument data types | Type ------------+-----------+------------------+---------------------+------ pg_catalog | factorial | numeric | bigint | func but you have it documented as factorial(numeric). regards, tom lane