Retool database superuser access

I am using pgadmin to create an event trigger and need superuser permissions. Is there a way to turn this on?

Hi @Shawn_Optipath, are you on Cloud or Self-hosted?

Hi @Paulo, I'm cloud using the retool db.

Thank you! What event trigger are you trying to create?

I was just doing some testing. Looking for a way to only show data linked to a particular user on the server side rather than an sql query.


CREATE OR REPLACE FUNCTION set_client_id() RETURNS event_trigger AS $$
    client_id UUID;
    SELECT id INTO client_id FROM clients WHERE email = current_user;
    PERFORM set_config('my.client_id', client_id::text, true);
$$ LANGUAGE plpgsql;

CREATE EVENT TRIGGER set_client_id_trigger ON login
EXECUTE FUNCTION set_client_id();

Thank you for sharing! Unfortunately, we can't create superuser permissions on RetoolDB. It is only possible on an external db that you can connect as a Resource. In my experience, the only way to filter this data on RetoolDB would be at the query level.

Ok, that's fine. It was a nice to have rather than a need for now.

1 Like