Using Array-Values in subselect

Поиск
Список
Период
Сортировка
От Alvar Freude
Тема Using Array-Values in subselect
Дата
Msg-id 3A11A5EF.C74A40EE@merz-akademie.de
обсуждение исходный текст
Ответы RE: Using Array-Values in subselect  ("Edmar Wiggers" <edmar@brasmap.com>)
Список pgsql-sql
Hi,

i want to create a linked structure of values. Each text has an id, an
array of children ids and the value itself.
 CREATE TABLE structure   (   id int8,   children int8[],   value text   );

Now i want to select all values which are connected to a given parent #x
at once. My first idea was this:
 SELECT value  FROM structure    WHERE id IN (SELECT children FROM structure WHERE id = #x);

But this causes an error because the array field just returns a string
instead of seperated values. Is there a way to make arrays return sort
of "real arrays" or something usable in a subselect in reasonable speed?


Thank you
Alvar



-- 
Alvar C.H. Freude  |  alvar.freude@merz-akademie.de
   Demo: http://www.online-demonstration.org/  |  Mach mit!
Blast-DE: http://www.assoziations-blaster.de/   |  Blast-Dich-Fit
Blast-EN: http://www.a-blast.org/               |  Blast/english


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

Предыдущее
От: Steve Wampler
Дата:
Сообщение: Re: Using a postgres table to maintain unique id?
Следующее
От: Roberto Mello
Дата:
Сообщение: Re: Using Array-Values in subselect