I have a such task:
1. table USERS
2. table DEPARTMENTS
- where each DEPARTMENT needs to store LIST of USERS in it
3. table FIRMS
- where each FIRM needs to store LIST of USERS in it
4. table EVENTS
- and where each EVENT needs to store LIST of _MEMBERS_ - USERS or
DEPARTMENTS or FIRMS in it
The only way i see - is to create extra table like MEMBERS (USER, INTHE) and
to
store records about membership of each user in departments and firms. But I
don't know how about it's efficiency.
I thought about using arrays in PSQL to create FIRMS (.., users int4[]), but
I havent' found how to make queries like "SELECT * FROM users WHERE id IN
(SELECT USERS from FIRMS).
Can anyone help or advice me something?
Thanks for reading my message.
Sorry for taking your time.
---
Bob Zatolokin