Re: Help with array constraints
От | Joe Conway |
---|---|
Тема | Re: Help with array constraints |
Дата | |
Msg-id | 3E8C75D4.6020500@joeconway.com обсуждение исходный текст |
Ответ на | Re: Help with array constraints (Jason Hihn <jhihn@paytimepayroll.com>) |
Список | pgsql-general |
Jason Hihn wrote: > Ah that's more like what I'm looking for. I have to attempt a select of the > new letter in the contrainted-to table. If it finds it, success! If the > contrainted-to table has an index, it should be very fast no matter how many > letters it's being constrained against... > "SELECT NEW.letter FROM constraint_table WHERE letter=id" > if null set raise exception. I didn't follow this thread in its entirety, but it sounds like you need an "array contains element x" function for use as a trigger? I think there may be something that does that already in contrib/array or contrib/intarray (I see you're not using int arrays, but maybe you could port the C code). > I would have thought this would be built in? Can it be? > I'm currently working on a fairly major upgrade to array support. No promises on exactly what will make it into 7.4, but I'm planning to look at contrib/array and contrib/intarray and rewrite or move as much of it as makes sense into the backend (subject of course to acceptance of the patches). Joe
В списке pgsql-general по дате отправления: