Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.10.1/8.10.1) with ESMTP id e7C1XvG29758 for ; Fri, 11 Aug 2000 21:33:57 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id VAA18555; Fri, 11 Aug 2000 21:32:10 -0400 (EDT) To: Forest Wilkinson cc: pgsql-sql@postgresql.org Subject: Re: non-cachable 'C' language functions In-reply-to: References: Comments: In-reply-to Forest Wilkinson message dated "Fri, 11 Aug 2000 18:18:13 -0700" Date: Fri, 11 Aug 2000 21:32:10 -0400 Message-ID: <18552.966043930@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200008/81 Forest Wilkinson 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