PostgreSQL - 尽管运行 CREATE LANGUAGE 语言 pgplsql 不存在

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2122207/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 23:59:42  来源:igfitidea点击:

PostgreSQL - Language pgplsql does not exist despite running CREATE LANGUAGE

postgresqlplpgsql

提问by Peter

I just tried to create my first plpgsql function. When executing the script, I get

我只是尝试创建我的第一个 plpgsql 函数。执行脚本时,我得到

ERROR: language "‘plpgsql'" does not exist

错误:语言“'plpgsql'”不存在

I then run the command CREATE LANGUAGE plpgsql; which shows the following error:

然后我运行命令 CREATE LANGUAGE plpgsql; 显示以下错误:

ERROR: language "plpgsql" already exists

错误:语言“plpgsql”已经存在

Commands are being run on the same database.

命令正在同一数据库上运行。

Regards

问候

Peter

彼得

回答by ls270400

use this command:

使用这个命令:

$: createlang -d dbname plpgsql

回答by ls270400

please notice that you have extra characters in your error. Most likely you wrote:

请注意,您的错误中有多余的字符。很可能你写道:

create function ... language ‘plpgsql'

kind of like mysql quotes things. It's bad syntax. Just make it

有点像 mysql 引用的东西。这是糟糕的语法。做吧

create function ... language plpgsql