| От | Lars Erik Thorsplass |
|---|---|
| Тема | Re: [GENERAL] Stored procedures and "pseudo" fields.. |
| Дата | |
| Msg-id | 7eeb33a040720150320bf5eed@mail.gmail.com обсуждение исходный текст |
| Список | pgsql-sql |
On Tue, 20 Jul 2004 09:45:06 -0600, Scott Marlowe <smarlowe@qwest.net> wrote: > > Kinda like this: > > > > SELECT *, acl_check( objects.obid, <user_id> ) AS mode FROM objects > > WHERE mode > 0; > > Here's the problem. In order to do the select, the query first needs to > run the where clause. I.e.: > > select a as test from table where a > 50; > > works, but > > select a as test from table where test > 50; > > fails. The reason is that when the where clause fires first, there IS > no test yet, as it hasn't been materialized. what you need to do is: > > select custom_function(a,b) from table where custom_function(a,b) > 0; > > Thanks for clearing that up. I just hoped there was some magic I could sprinkle on my query to get away from the extra overhead of running the procedure twice :) Best regards.. L.E.Thorsplass
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера