The best table's scheme?

From: "Bob Zatolokin" <littleB(at)ogl(dot)spb(dot)ru>
To: <pgsql-general(at)postgresql(dot)org>
Subject: The best table's scheme?
Date: 2000-09-27 07:45:33
Message-ID: 000b01c02856$ecae0560$66bd08c2@littleb
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message admin 2000-09-27 08:18:25 Re: Int8 problem
Previous Message Holger Klawitter 2000-09-27 07:43:08 Re: importing tab delimited, text enclosed by "