I have a database in which tables are created for each user when they create an account. These auto generated tables are used for generating analytics using a Function. This function is defined as a SECURITY DEFINER. So that any user who tries to execute this function will be doing so as a Super user.
But it is not working as expected. For Example, When execute the functions as User1, I get an error that the User1 is unable to select the table. When I execute the functions as postgres user, I still get the same error!!!
Was able to execute the function only after GRANT SELECT on that table.
My question is, When I execute the function as a Superuser, How come I get an error on Unable to select the table?
If you are superuser, then you can see all - there are no any limit. It is impossible to do any limit of superuser in Postgres.