PostgreSQL程序语言“C”未找到

我试图在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.

相关文章

项目需要,有个数据需要导入,拿到手一开始以为是mysql,结果...
本文小编为大家详细介绍“怎么查看PostgreSQL数据库中所有表...
错误现象问题原因这是在远程连接时pg_hba.conf文件没有配置正...
因本地资源有限,在公共测试环境搭建了PGsql环境,从数据库本...
wamp 环境 这个提示就是说你的版本低于10了。 先打印ph...
psycopg2.OperationalError: SSL SYSCALL error: EOF detect...