postgresql中的Crosstab()函数会导致错误.(已安装tablefunc模块)

man*_*exx 2 sql postgresql crosstab

我正在使用postgresql 9.3.9.

CREATE EXTENSION tablefunc;成功了.现在,当我尝试进行简单的交叉表查询时,例如:

select * from crosstab('select col_1, col_2 from table order by 1,2')
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

Error in query: ERROR: function crosstab(unknown) does not exist
HINT: No function matches the given name and argument types. You might need to add explicit type casts
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?我尝试在文本中添加显式强制转换,但这没有帮助.

man*_*exx 5

要检查扩展名是否确实已安装,请执行以下操作:

select count(*) from information_schema.routines where routine_name like 'crosstab%'
Run Code Online (Sandbox Code Playgroud)

如果返回0,则应检查是否在正确的数据库中安装了扩展,以及是否提交了该CREATE EXTENSION语句.