array column -- do you really want this?

From: Oliver Seidel <seidel(at)imr-int(dot)intra(dot)in-medias-res(dot)com>
To: Umashankar Kotturu <adityauma(at)hotmail(dot)com>
Cc: pgsql-sql(at)hub(dot)org
Subject: array column -- do you really want this?
Date: 2000-09-05 07:40:28
Message-ID: Pine.LNX.4.21.0009050930220.9722-100000@imr-int.intra.in-medias-res.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello Umashankar,

*warning* this doesn't answer the question you asked *warning*

you write that you are new to object databases. The problem that you
describe sounds like it might much more completely be solved by not using
the object features and avoiding an array alltogether.

If you simply wish to solve the problem, then I can recommend some reading
on normal forms, which goes into all the problems that can occur in
databases without consideration for storage anomalities. You can find a
good article here:

http://home.earthlink.net/~billkent/Doc/simple5.htm

Your database would then be in "first normal form" and not contain lists
inside a field any more. You simply create two columns, the first listing
the patient ID and the second listing the illness. Patient IDs are
allowed to occur repeatedly. You could retrieve all illnesses for a
particular patient by the use of:

select illness from patient_illness where patient_id=1434;

or you may retrieve all patients' illnesses by querying:

select * from patient_illness order by patient_id,illness;

I hope that helps,

Oliver

Browse pgsql-sql by date

  From Date Subject
Next Message nicolas.michaud 2000-09-05 09:22:25 Protection of tables by group and not by users
Previous Message Andreas Tille 2000-09-05 06:26:06 Re: Order by in stored functions