Skip site navigation (1) Skip section navigation (2)

Arrays how to...

From: Olivier PRENANT <ohp(at)pyrenet(dot)fr>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Arrays how to...
Date: 2000-07-27 11:00:04
Message-ID: Pine.UW2.4.21.0007271252470.22019-100000@server.pyrenet.fr (view raw or flat)
Thread:
Lists: pgsql-hackers
Hi all,

I'm banging my head over this one:

I want to set a table like this:
CREATE TABLE readers (
name varchar not null primary key,
documents int[]);

where name is the name of a reader and documents a list of documents he
can access.

So it's easy to say: hi, you're authorized to read his, this and this.

Now I want to know who can read document x (there can be sevral readers
for a single doc)

I also want to put referencial integrity in that each document listed has
to be in a documents table.

How can I do that?

Maybe the simplest solution is one row per reader/document. 

Any clues?
-- 
Olivier PRENANT         	Tel:	+33-5-61-50-97-00 (Work)
Quartier d'Harraud Turrou           +33-5-61-50-97-01 (Fax)
31190 AUTERIVE                      +33-6-07-63-80-64 (GSM)
FRANCE                      Email: ohp(at)pyrenet(dot)fr
------------------------------------------------------------------------------
Make your life a dream, make your dream a reality. (St Exupery)


pgsql-hackers by date

Next:From: Bruce MomjianDate: 2000-07-27 13:00:25
Subject: Re: mac.c
Previous:From: Hiroshi InoueDate: 2000-07-27 10:30:08
Subject: RE: AW: Vacuum only with 20% old tuples

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group