I want to create a role for connecting with the back-end, and I want it to only have select, insert, update, and delete permissions to prevent SQL injection.
I use this script:
ALTER ROLE "SIUD" WITH NOSUPERUSER NOCREATEDB NOCREATEROLE NOREPLICATION;
REVOKE CREATE ON SCHEMA public FROM "SIUD";
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO "SIUD";
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO "SIUD";
This successfully prevents the creation or dropping of databases and roles, but I can still create and drop tables. How can I prevent the creation or dropping of tables?