Re: non-cachable 'C' language functions
От | Tom Lane |
---|---|
Тема | Re: non-cachable 'C' language functions |
Дата | |
Msg-id | 18552.966043930@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | non-cachable 'C' language functions (Forest Wilkinson <fspam@home.com>) |
Список | pgsql-sql |
Forest Wilkinson <fspam@home.com> writes: > Is my understanding correct? What should I do about it? The postgresql > 6.5.2 docs for CREATE FUNCTION don't tell me how to make my functions > non-cachable. 6.5 doesn't pay any attention to proiscachable, AFAIR. 7.0 does, but it defaults to assuming proiscachable = FALSE; you have to say "with (iscachable)" in CREATE FUNCTION to get the other behavior. There is a problem in both versions that WHERE clauses containing no variables (table fields) will be assumed to be constants even if they contain non-cachable function calls :-(. Thus, for example,select * from foo where random() < 0.5 doesn't work as desired. I plan to fix this for 7.1. Offhand I don't see a use for a nextval-like function in WHERE, so you're probably safe with both 6.5 and 7.0. regards, tom lane
В списке pgsql-sql по дате отправления: