While the current connection is made to db1, I want to change privileges on db2. Like:
GRANT ALL PRIVILEGES ON SCHEMA "db2"."public" TO "user";
But this results in error, and PostgreSQL does not recognize the database qualifier in the statement! Is there any way I can do this without disconnecting from db1 and reconnecting to db2?
BTW, I'm commencing these commands from a programming language and not the psql
.
[UPDATE]
As I was told in comments, it seems that this feature is intentionally blocked (due to implementation challenges or security reasons - I'm not sure).
In any case, I don't see a good reason for that and that's my personal opinion. If it is hard to implement, then it's a design flaw. And I think the security argument can be easily scratched as adding steps to the process for a user who's already been authenticated and authorized to do so, is not considered a better security.
Again, just my opinion.
In any case, I'm really thankful for all the time and effort put into PostgreSQL project. Thanks guys.