I got an error while creating this function. can you solve it?
CREATE OR REPLACE FUNCTION my_schema.test($1"date")
RETURNS date(-1)
LANGUAGE SQL
IMMUTABLE
AS $$
SELECT (date_trunc('MONTH', $1) + INTERVAL '1 MONTH - 1 day')::date;
$$
;
ERROR: syntax error at or near "$1"
if I remove the $1 from parameter input the error is:
type modifier is not allowed for type "date".