pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Forest Wilkinson <fspam@home.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: non-cachable 'C' language functions
Date: Fri, 11 Aug 2000 21:32:10 -0400
Message-ID: <18552.966043930@sss.pgh.pa.us> (raw)
In-Reply-To: <kj89psotsjohu3nqb2nb2iotigd5d844d2@4ax.com>
References: <kj89psotsjohu3nqb2nb2iotigd5d844d2@4ax.com>

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



view thread (2+ messages)

Message-ID: <18552.966043930@sss.pgh.pa.us>
Permalink:  ../18552.966043930@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/18552.966043930@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, fspam@home.com
  Subject: Re: non-cachable 'C' language functions
  In-Reply-To: <18552.966043930@sss.pgh.pa.us>
  References: <kj89psotsjohu3nqb2nb2iotigd5d844d2@4ax.com> <18552.966043930@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox