Charles,
I just tried installing calendar (fresh copy from CVS). It fails to install. This makes testing your issue with the query much more difficult, so you might want to ensure that what you commit can at least be installed, before further chasing down the issue with the unique/distinct query 😊
I see the error :
couldn't open "/var/lib/aolserver/servers/openacs4/packages/calendar/www/admin/cal-item-permissions-postgresql.xql": no such file or directory
when I try to install calendar. So your .info file is out of sync with the set of files you have committed to CVS. You may just need to regenerate the .info file and commit that changed file, or you may need to check that you haven't forgotten to add/commit one or more other files.
I see the file packages/calendar/www/admin/cal-item-permissions.tcl is there, so I think perhaps you forgot to cvs add and/or cvs commit the corresponding .xql file(s). There are *no* .xql files under www/admin at all, so maybe you need them for some of the other .tcl files there as well?
If you can commit the missing file(s), so the package will install, then I'll give calendar a tryout...