Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: stable functions



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


Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group