Re: stable functions

From: Filip Rembiałkowski <plk(dot)zuber(at)gmail(dot)com>
To: "Vincenzo Romano" <vincenzo(dot)romano(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: stable functions
Date: 2007-05-31 11:23:36
Message-ID: 92869e660705310423p32def3d4k54c156600fdd622b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2007/5/31, Vincenzo Romano <vincenzo(dot)romano(at)gmail(dot)com>:
> Hi all.
>
> Can functions whose effect is to create functions (yep!)
> be labelled as "stable"?

According to the docs, no.

"STABLE indicates that the function cannot modify the database (...)
any function that has side-effects must be classified volatile"

http://www.postgresql.org/docs/8.2/static/sql-createfunction.html

If you labeled creatorfunc(param) as stable, ant then issued "SELECT
creatorfunc(sometable.param) FROM sometable", there is a theoretical
risk that creatorfunc would be called only _once_ for each distinct
value of param.

--
Filip Rembiałkowski

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vincenzo Romano 2007-05-31 11:38:49 Re: stable functions
Previous Message Erwin Moller 2007-05-31 11:01:19 TSEARCH2: disable stemming in indexes and triggers