Why does the Crosstab function not work in Windows? Using Postgresql

Asked

Viewed 48 times

0

I built a query that has a Crosstab, in the database manager works perfectly and gives no error, but when I run this query inside my project that is in Laravel, it explodes an error saying that the function does not exist.

> Error: SQLSTATE[42883]: Undefined Function: 7 ERROR: Crosstab(Unknown) function does not exist

I have tried to execute the command below:

CREATE EXTENSION tablefunc;

But he says the function already exists.

My database is Postgresql, and my project is in Laravel.

1 answer

0

I managed to solve you guys myself!

Just put the schema name before the 'Crosstab' function, and if it doesn’t work put the public before the function, because it may be that the database functions can be configured publicly and not for each schema. if none works run the command below that everything will work perfectly.

CREATE EXTENSION tablefunc;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.