I have a DB with many objects. All are owned by a role called app. This role is currently used by everyone and everything (manual users, rollout scripts, app itself ...).
The goal now is to have a shorter idle_in_transaction_session_timeout for manual users than for the rollout scripts.
I was told that creating a new role for manual users is the way to go. For simplicity, let's say there is only one manual user frank.
The goal would be that frank can create/alter/drop every object he or app created/owns and that app can create/alter/drop every object he or frank created/owns.
This seems difficult in postgres due to the way it works (creator = owner, only owner can alter/drop etc...).
Searching the internet for a solution only brings partial and quite complicated solutions such as event trigger on create table or not forgetting to issue set role always.
What is the best practice here?
*** Update: one suggestion below is to grant app to frank, but that does not do the trick. It causes the scenario that app can not modify objects created by frank:
CREATE ROLE "app" LOGIN;
CREATE ROLE "frank" LOGIN;
GRANT "app" TO "frank";
set role app;
create table created_by_app (id int);
set role frank;
create table created_by_frank (id int);
drop table created_by_app; -- works
set role app;
drop table created_by_frank; -- does not work
-- SQL Error [42501]: ERROR: must be owner of table created_by_frank