Tom,
Instead of going to postgres, there is an easier way. Exec into the container and run awx-manage shell_plus (Google Django shell). All the python Django models will be imported for you so you can run queries like Group.objects.filter(name=“foobar”)
You can Google Django queries to craft the need.