Re: Arrays and foreign keys

Поиск
Список
Период
Сортировка
От Chris Bitmead
Тема Re: Arrays and foreign keys
Дата
Msg-id 3993836F.5379B24C@nimrod.itg.telecom.com.au
обсуждение исходный текст
Ответ на Re: Arrays and foreign keys  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Ответы Re: Arrays and foreign keys  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-hackers
Stephan Szabo wrote:

> And whatever is done should leave arrays with the same meaning they
> currently have for people who use them in other ways.  I'm almost
> thinking that we want a set rather than an array here where sets have
> different semantics that make more sense for this sort of behavior.
> It just seems to make more sense to me that a set would be indexed
> by its elements than array, since position is supposed to be meaningful
> for arrays, and that set(1,2) is equal to the set(2,1) whereas the
> indexes aren't.  Of course, I guess that's not much different from
> the normalized table case.

Probably a collection rather than a set. No sense in excluding
duplicates.

What often happens in an ODBMS is that some general purpose collection
classes are written based on arrays. A simple example would be...

class Set<type> {   RefArray<type> array;
}

Where RefArray<Object> gets mapped to something like oid[] in the odbms.
Then when you want a class that has a set..

class Person {  Set<Car> owns;
}

which gets flattened and mapped to
create table Person (owns oid[]);

The set semantics being enforced by the language bindings.


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Don Baccus
Дата:
Сообщение: Re: [Fwd: Re: haven't forgotten about you...]
Следующее
От: Mario Weilguni
Дата:
Сообщение: Identified a problem in pg_dump with serial data type and mixed case