Re: Arrays and foreign keys
От | Stephan Szabo |
---|---|
Тема | Re: Arrays and foreign keys |
Дата | |
Msg-id | Pine.BSF.4.10.10008100941010.64041-100000@megazone23.bigpanda.com обсуждение исходный текст |
Ответ на | Re: Arrays and foreign keys (Kaare Rasmussen <kar@webline.dk>) |
Ответы |
Re: Arrays and foreign keys
|
Список | pgsql-hackers |
On Thu, 10 Aug 2000, Kaare Rasmussen wrote: > > Well, the two types aren't the same (one is an integer the > > other an integer array,) so I wouldn't expect it to work. Note: > > Eh, I could figure that out myself. What I'm asking for is if there is a way to > combine arrays with foreign keys? For what you want, maybe. Probably defining an equals operator to make the two types comparable for equality would allow the constraint to work. > I believe the answer for now is 'no', but did like to get it confirmed, and > also draw attention to this if someone wants to make it. > > > * Make sure that types used in foreign key constraints > > are comparable. > > And maybe > * Add foreign key constraint for arrays Actually, it would be: * Change foreign key constraint for array -> element to mean element in array, since the constraints seem to work on arrays (make two integer arrays and reference them and it seems to work in my two minute test). The question is whether or not we want to extend the spec in this way. It would probably be easy to do, but it's definately an extension, since the spec says that the two things should be equal, and I don't generally think of element in array as equality. And, what do we do if neither the in operator nor equals is defined between array and element?
В списке pgsql-hackers по дате отправления: