CREATE OR REPLACE FUNCTION CLEAN_STRING(in_str varchar) returns varchar
AS
$$
def strip_slashes(in_str):
while in_str.endswith("\\") or in_str.endswith("/"):
in_str = in_str[:-1]
in_str = in_str.replace("\\", "/")
return in_str
clean_str = strip_slashes(in_str)
return clean_str
$$
LANGUAGE plpythonu ;
This gives me IndentationError
. However, If I remove backslashes, it works fine. How can I handle backslashes inside plpythonu?
I used a below work-around for now.