【发布时间】:2018-07-14 16:10:11
【问题描述】:
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 ;
这给了我IndentationError。但是,如果我删除反斜杠,它工作正常。如何处理 plpythonu 中的反斜杠?
【问题讨论】:
标签: postgresql greenplum plpython postgres-plpython