4

我是 PostgreSQL 的初学者。我得到了一个 PostgreSQL 的 SQL 补丁,并在执行 SQL 时对其进行了配置。我收到以下错误。我的背景是 MySQL。

询问

CREATE FUNCTION wine_entry_script() RETURNS trigger
    LANGUAGE plperlu AS
$$
   #!/usr/bin/perl -w
   use strict;
   require ('/var/lib/pgsql/data/Trigger_Processor1.0.pl');
$$;

错误

错误:语言“plperlu”不存在 SQL 状态:42704 提示:使用 CREATE LANGUAGE 将语言加载到数据库中。

4

2 回答 2

10

plperluplperl 的不受信任版本。它是 PostgreSQL 中准备好的选择之一。看一看:

SELECT * FROM pg_language;

如果你想使用它,你必须每个数据库运行一次:

CREATE LANGUAGE plperlu;

不过,请注意安全隐患。
更多在手册中。


Most Linux systems come with Perl installed. Under Windows, make sure that some flavor of Perl is installed in your system (providing the required dll files) before you can create the language.

Related:

于 2012-01-16T09:59:54.300 回答
4

create the extension and then the language.

CREATE EXTENSION plperl;
CREATE LANGUAGE plperlu;
于 2014-06-12T18:24:02.253 回答