I'm trying to create a function, like so:
CREATE FUNCTION RETURNONE(DATE)
BEGIN
RETURN 1;
END
However, when I run this in psql 9.5 I get the following error:
ERROR: syntax error at or near "BEGIN"
LINE 2: BEGIN
^
END
I did see this other StackOverflow thread with a reminiscent problem. Per the second answer, I re-encoded my code in UTF 8, which did nothing. This is my first ever SQL function, so I'm sure I'm missing something painfully obvious. Let me know what!