On 10-02-2021 11:36, Midsoft UK wrote:
> Hi
> What I'm trying to achieve is creating a role that has read/write access
> to the whole database. I can the login with any user and use the role as
> needed.
From a security perspective it doesn't make much sense to give all
users all rights. If you want those rights to apply always (instead of
only when the role is specified), you can also grant privileges to USER
PUBLIC.
> I can't see anything anywhere that explains that. I can only see it at
> table level so maybe it's not possible ?
You cannot grant all privileges on all tables, you need to grant
privileges on each table individually.
So if you have tables TABLE1, TABLE2, TABLE3, you need to execute
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE1 TO ROLE yourrole;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE2 TO ROLE yourrole;
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE3 TO ROLE yourrole;
etc..
(If you also want to grant REFERENCES, then you can replace SELECT,
INSERT, UPDATE, DELETE with ALL).
Mark
--
Mark Rotteveel