I'm trying to create a function with two text parameters, second one should have a default value "en" (it is a localisation parameter).
CREATE FUNCTION nav.getpathtext_new(path text, locale text DEFAULT "en") RETURNS json AS
$BODY$DECLARE
-- function code here ...
RETURN array_to_json(_toJson);
END$BODY$
LANGUAGE plpgsql VOLATILE NOT LEAKPROOF;
And I'm getting error:
ERROR: column "en" does not exist
LINE 1: ...getpathtext_new(path text, locale text DEFAULT "en") RETU..
^
PostgreSQL version is 9.4. What am I doing wrong?
DEFAULT 'en'