CREATE OR REPLACE FUNCTION "scheme"."function" (var varchar) RETURNS varchar AS
DECLARE
res varchar;
BEGIN
/* Which is correct? This: */
SELECT col1 FROM table WHERE col2=var INTO res;
/*Or this:*/
SELECT col1 FROM table WHERE col2=quote_literal(var) INTO res;
RETURN res;
END;