W porządku mam funkcję:
CREATE OR REPLACE FUNCTION sha1(bytea)
RETURNS character varying AS $BODY$
BEGIN RETURN ENCODE(DIGEST($1, 'sha1'), 'hex');
END;
$BODY$
LANGUAGE 'plpgsql'
wywołanie:
SELECT sha1('test')
i odpowiedź:
"ERROR: function digest(bytea, unknown) does not exist
LINE 1: SELECT ENCODE(DIGEST( $1 , 'sha1'), 'hex')
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
QUERY: SELECT ENCODE(DIGEST( $1 , 'sha1'), 'hex')
CONTEXT: PL/pgSQL function "sha1" line 2 at RETURN"
Co tu jest źle ?