The best table's scheme? - Mailing list pgsql-general

From Bob Zatolokin
Subject The best table's scheme?
Date
Msg-id 000b01c02856$ecae0560$66bd08c2@littleb
Whole thread Raw
List pgsql-general
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


pgsql-general by date:

Previous
From: "admin"
Date:
Subject: Re: Int8 problem
Next
From: Holger Klawitter
Date:
Subject: Re: importing tab delimited, text enclosed by "