Sample Header Ad - 728x90

postgresql grant user privilages to dynamically created tables

0 votes
2 answers
756 views
We have 2 postgresql users. One user (dbworkeruser) for creating tables dynamically (from C# worker) and other user (injestworkeruser) for inserting data into these tables (from another C# worker as well). The main issue that we have is that, every time we do drop/create new tables dynamically (on runtime) we get exception that the user injestworkeruser doesn't have enough permission to select or insert data from/into these newly created tables. This is the created user: CREATE USER injestworkeruser WITH LOGIN NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION; Is there anyway to grant the user permissions to apply CRUD operations to any newely created table? This one didn't work for me as this applies to the existing tables: GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO injestworkeruser;
Asked by alaa_sayegh (133 rep)
Aug 11, 2020, 06:31 PM
Last activity: Sep 21, 2022, 02:06 PM