maniexx
maniexx

Reputation: 695

Crosstab() function in postgresql causes error. (tablefunc module installed)

I am using postgresql 9.3.9.

I did CREATE EXTENSION tablefunc;successfully. Now, when I try to do a simple crosstab query, e.g:

select * from crosstab('select col_1, col_2 from table order by 1,2')

I get this error:

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

What am I doing wrong? I tried adding an explicit cast to text, but that did not help.

Upvotes: 2

Views: 6357

Answers (1)

maniexx
maniexx

Reputation: 695

To check if the extension is really installed, do:

select count(*) from information_schema.routines where routine_name like 'crosstab%'

If it returns 0, you should check if you installed the extension in the right database, and whether you commited the CREATE EXTENSION statement.

Upvotes: 7

Related Questions