Re: pl/pgsql array return
От | Tom Lane |
---|---|
Тема | Re: pl/pgsql array return |
Дата | |
Msg-id | 29080.1013617618@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: pl/pgsql array return ("Dave Cramer" <Dave@micro-automation.net>) |
Список | pgsql-jdbc |
> I hope someone can help me. Is it possible to return an array of > results from a query in a function in pl/pgsql and get this result via > the jdbc. Could someone send me an example of how this is done. You can return an array value from plpgsql, no problem. The problem is that plpgsql is pretty weak on functionality for constructing an array value on the fly. I think the only way that would work is to build up a textual representation of an array literal ('{foo,bar,baz}') and then rely on runtime type conversion to do the right thing when you try to RETURN the text string from a function declared as returning int[] or whatever. You might have better luck doing this in pltcl or plperl, either of which have string-mashing facilities far superior to plpgsql. regards, tom lane
В списке pgsql-jdbc по дате отправления: