Re: SELECT from record-returning function causes function code to be executed multiple times
В списке pgsql-general по дате отправления:
| От | David Johnston |
|---|---|
| Тема | Re: SELECT from record-returning function causes function code to be executed multiple times |
| Дата | |
| Msg-id | 1387145351920-5783497.post@n5.nabble.com обсуждение исходный текст |
| Ответ на | SELECT from record-returning function causes function code to be executed multiple times (dbaston <dbaston@gmail.com>) |
| Список | pgsql-general |
dbaston wrote > I'm wondering if this is expected behavior? Yes. The proper way to handle this is by putting the SRF in the FROM clause. If you must have it in the select clause you should do this: WITH srf_call ( SELECT srf_function() AS srf_result ) SELECT (srf_call.srf_result).* FROM srf_call; Note that if you are using 9.3 you likely can make use of the new LATERAL construct to leave the SRF call in the FROM clause while still pulling parameter values from the same level in the query (which is the main reason for moving the SRF to the select-list). David J. -- View this message in context: http://postgresql.1045698.n5.nabble.com/SELECT-from-record-returning-function-causes-function-code-to-be-executed-multiple-times-tp5783495p5783497.html Sent from the PostgreSQL - general mailing list archive at Nabble.com.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера