Repo dump有以下输出
--
-- Name: add_em(integer, integer); Type: FUNCTION; Schema: public; Owner: developer
--
CREATE FUNCTION public.add_em(x integer, y integer) RETURNS integer LANGUAGE sql AS $ $
SELECT
x + y;
$ $;
ALTER FUNCTION public.add_em(x integer, y integer) OWNER TO developer;
字符串
但是当我运行psql -f
试图恢复数据库时,我得到了这个错误
psql:lib/scripts/repo/structure:87: ERROR: syntax error at or near "$"
LINE 1: ...em(x integer, y integer) RETURNS integer LANGUAGE sql AS $ $
型
1条答案
按热度按时间6vl6ewon1#
用于美元报价的标记必须遵守未加引号的标识符的规则(除了区分大小写和不允许
$
之外),因此空格是无效的。字符串