Обсуждение: arrays of tables

Поиск
Список
Период
Сортировка

arrays of tables

От
Christoph Steinbeck
Дата:
I was impressed to learn that the object oriented features of pgsql
allow for using a table name as a column name in another table, like

create table candy(blah....);
create table jar(size int, type candy);

Now it does not seem to be possible to use "arrays of tables", which
would be very useful (That's at least what I think).

Assume you have a chemical database, with a table of atoms (number int,
symbol text, partners int[]), then you could nicely have a table of
molecules(number int, name text, consistsOf atoms[]).
I'm sure that's done somewhat different in regular relational database
design and it's also an everyday problem, but from an object oriented
point of view, that woult be the way to go. Right?

Or am I doing something wrong?

Cheers,

Christoph

--
Dr. Christoph Steinbeck (http://www.ice.mpg.de/~stein)
MPI of Chemical Ecology, Tatzendpromenade 1a, 07745 Jena, Germany
Tel: +49(0)3641 643644 - Mobile: +49(0)177 8236510 - Fax: +49(0)3641
643665

What is man but that lofty spirit - that sense of enterprise.
... Kirk, "I, Mudd," stardate 4513.3..

Re: [GENERAL] arrays of tables

От
"Rudy Gireyev"
Дата:
Hmmm, it doesn't sound like you really need an array
of tables unless you plan to have a separate table for each atom.
Most likely, however, you will have all your atoms in one table
in which case you can simply store the key for the set of
atoms you are interested in, in the molecules table.
That I think is the standard relational model.

Rudy

On 9 Sep 99, at 12:02, Christoph Steinbeck wrote:

> I was impressed to learn that the object oriented features of pgsql
> allow for using a table name as a column name in another table, like
>
> create table candy(blah....);
> create table jar(size int, type candy);
>
> Now it does not seem to be possible to use "arrays of tables", which
> would be very useful (That's at least what I think).
>
> Assume you have a chemical database, with a table of atoms (number
> int, symbol text, partners int[]), then you could nicely have a table
> of molecules(number int, name text, consistsOf atoms[]). I'm sure
> that's done somewhat different in regular relational database design
> and it's also an everyday problem, but from an object oriented point
> of view, that woult be the way to go. Right?
>
> Or am I doing something wrong?
>
> Cheers,
>
> Christoph
>
> --
> Dr. Christoph Steinbeck (http://www.ice.mpg.de/~stein)
> MPI of Chemical Ecology, Tatzendpromenade 1a, 07745 Jena, Germany Tel:
> +49(0)3641 643644 - Mobile: +49(0)177 8236510 - Fax: +49(0)3641 643665
>
> What is man but that lofty spirit - that sense of enterprise.
> ... Kirk, "I, Mudd," stardate 4513.3..
>
> ************
>
>