CREATE OR REPLACE FUNCTION nn_db.image_post(
	in_file_name nn_db.image.file_name%TYPE
	, in_file_ext nn_db.image.file_ext%TYPE
	, in_fk_application nn_db.image.fk_application%TYPE)
RETURNS TABLE(pk_image nn_db.image.pk_image%TYPE)
AS $$
BEGIN
	INSERT INTO nn_db.image (file_name, file_ext, fk_application)
	VALUES (in_file_name, in_file_ext, in_fk_application);
	RETURN QUERY SELECT MAX(nn_db.image.pk_image) FROM nn_db.image;
END;
$$ LANGUAGE plpgsql