"permission denied" for view

Using the latest dev version from github, I’ve connected to a postgres database. Normal queries work well, but when using a view (CREATE VIEW myview AS ...) I’m getting “Query failure: ERROR: permission denied for relation” in the logs and “We couldn’t understand your question” in the web gui.

Any tips how to debug this further? The raw SQL from the server log I can execute from psql normally.

The view I need in the first place for using more than one table for my query.

Oh never mind, it was a permissions problem on the Postgres side. Solved it by GRANTing all permissions to the view.

1 Like

I’m having the same issue today, with a view.

I first created the view using another account, then figured Metabase couldn’t access it. So I deleted the view and created it again using the same account as the one Metabase uses.

But I still get this same message, I tried re-scan the whole DB and invalidate the cache but it doesn’t work.
I don’t quite understand why.

@Vadorequest-sl to try ti isolate: How does it behave when you access your DB from a different tool than Metabase with the same credentials?

If you have the problem isolated to Metabase does the log reveal anything? (both during scan and when you try to access the view - and this both with raw SQL and throug a “normal query”)

1 Like

The issue was indeed in the DB itself, I had create the view with the same user as the one I used to create the other views, but I’m using a particular read only account through metabase who didn’t have access to those views, unlike what I stated/thought.

1 Like