Make SQL functions appear only once in the least

Before, the same function was appearing one time for every signature it
had. See #643