| От | Michael Fuhr |
|---|---|
| Тема | Re: set-returning function in pg 7.4.6 |
| Дата | |
| Msg-id | 20050314160652.GA45430@winnie.fuhr.org обсуждение |
| Ответ на | set-returning function in pg 7.4.6 (Raphael Bauduin <raphael.bauduin@be.easynet.net>) |
| Список | pgsql-novice |
On Mon, Mar 14, 2005 at 04:50:38PM +0100, Raphael Bauduin wrote: > for r in EXECUTE ''select customer_id from customers'' loop If the query is static (i.e., not generated) and you're not working with a temporary table, then you can omit EXECUTE: FOR r IN SELECT customer_id FROM customers LOOP The function might benefit from using a cached plan in this case. > select GetRows(); > > I get this error: > > ERROR: set-valued function called in context that cannot accept a set > CONTEXT: PL/pgSQL function "getrows" line 5 at return next It should be: SELECT * FROM GetRows(); -- Michael Fuhr http://www.fuhr.org/~mfuhr/
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера