I guess I ought to be more specific.
- What does ad_general_permissions.user_has_row_permissions_p($user_id,'read',version_id,'FS_VERSIONS') = 't' do? And why can't we use the same thing in Postgres, or write something that works the same in the SQL statment?
- It looks like answers, pset, and sol are the effects of these select statements. It also looks like:
- pset is joining ad_general_permissions to fs_versions_latest.
- sol is joinging edu_tasks_solutions with fs_versions_latest.
- answers is joining fs_versions_latest, edu_student_answers, and fs_files.
If we really can't get something to work like asked above, what's your feedback to building three views for the case? I know, they probably couldn't be reused very easily. But, it would probably work.
- Why is there edu_assignments1? What is the benefit of referencing a second instance of the table? Can't we just join answers to edu_assignments? If so, that would leave us with edu_answers, pset, answers, and sol to join. Is that right? Possible?