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程序语言?
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.