I have a table of users eg:
create table \"user\" ( id serial primary key, name text not null, superuser boolean not null default false );
I don't know if this is a good way to do it but it seems to work
INSERT INTO user_has_job (user_id, job_id) VALUES (you_user_id, your_job_id) WHERE EXIST ( SELECT * FROM user WHERE id=your_user_id AND superuser=true );