加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

PostgreSQL程序语言“C”未找到

发布时间:2020-12-13 16:15:28 所属栏目:百科 来源:网络整理
导读:我试图在PostgreSQL 9.2数据库中使用 PL/R过程语言.我已经安装了plr语言,我正在尝试将其添加到数据库中.当我运行命令CREATE EXTENSION plr;我收到以下错误: ERROR: language "C" does not existSTATEMENT: CREATE EXTENSION plr;ERROR: language "C" does n
我试图在PostgreSQL 9.2数据库中使用 PL/R过程语言.我已经安装了plr语言,我正在尝试将其添加到数据库中.当我运行命令CREATE EXTENSION plr;我收到以下错误:
ERROR:  language "C" does not exist
STATEMENT:  CREATE EXTENSION plr;
ERROR:  language "C" does not exist

当我使用select * from pg_language列出数据库中的可用语言时;我明白了

lanname  | lanowner | lanispl | lanpltrusted | lanplcallfoid | laninline | lanvalidator | lanacl 
 ----------+----------+---------+--------------+---------------+-----------+--------------+--------
  internal |       10 | f       | f            |             0 |         0 |         2246 | 
  c        |       10 | f       | f            |             0 |         0 |         2247 | 
  sql      |       10 | f       | t            |             0 |         0 |         2248 | 
  plpgsql  |       10 | t       | t            |         12514 |     12515 |        12516 | 
 (4 rows)

所以有一种语言c但它不是大写字母(不确定这是否有所不同).

我想知道为什么plr扩展名没有找到C程序语言?

您可能在PostgreSQL 9.2(引用 release notes here)中遇到此更改:

No longer forcibly lowercase procedural language names in CREATE
FUNCTION (Robert Haas)

While unquoted language identifiers are still lowercased,strings and
quoted identifiers are no longer forcibly down-cased. Thus for example
CREATE FUNCTION … LANGUAGE ‘C’ will no longer work; it must be
spelled ‘c’,or better omit the quotes.

它也反映在manual for CREATE FUNCTION

lang_name

The name of the language that the function is implemented in. Can be SQL,C,internal,or the name of a user-defined procedural
language. For backward compatibility,the name can be enclosed by
single quotes.

至少从版本7.3(可能更长)开始,不鼓励引用语言名称,但显然老习惯很难.删除’C’周围的引号可以解决问题,到达:LANGUAGE c或LANGUAGE C.

从project page开始,PL / R在这方面还没有为PostgreSQL 9.2做好准备.

从反馈Joe Conway

Joe Conway留下了一个被删除的答案,因为它应该是一个评论.我将它粘贴到一般公众身上,无法看到已删除的答案:

I got the message,just haven’t had the time to do a new PL/R release. Look for it by December,but in the meantime the manual workaround noted above is pretty simple.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读