Forum OpenACS Q&A: Response to There's a problem with education/class/one.tcl

Collapse
Posted by Don Baccus on
1.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? 
Postgres doesn't have packages, but there are equivalents available in the port. Look at the general permissions SQL file for more info.

I just spent the day digging through intranet, portals, etc weeding out bugs so am not up to tackling this one at the moment, but wanted to mention that. Also, a big clue - get your head around what the query really wants to do, then look into re-writing it within the limitations of PG rather than trying a mechanical translation. I just simplified and fixed some complex unfoldings of outer joins in the intranet module based on doing this (which is not a criticism of our team member who did the original unfolding, it was an early big effort on his part and he had no real help from me or others who'd been down that path before).

Along with this, I've found that some of the more complex queries I've dealt with can easily be restructured to avoid some of the porting hassle. No knock on aD here (though I'm not surrendering my right to knock 'me right and left as I see fit!) but taking a straightforward approach in Oracle that doesn't necessarily port easily is no sin on their part.