Question about IMMUTABLE function

From: "petrov(dot)boris(dot)v(at)mail(dot)ru" <petrov(dot)boris(dot)v(at)mail(dot)ru>
To: pgsql-novice(at)postgresql(dot)org
Subject: Question about IMMUTABLE function
Date: 2015-11-17 17:54:42
Message-ID: 564B69E2.7040209@mail.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi
Documentation states, that IMMUTABLE "... guaranteed to return the same
results given the same arguments forever." My doubts are regarding
'forever' word.
Q1: Can I safely mark as IMMUTABLE
FUNCTION calc_col_gen_full_weburl(content_pages_table)
Which is used in following context:
SELECT p.id, p.calc_col_gen_full_weburl FROM content_pages_table;
Given that:
1. It internally does SELECT. It looks at other rows in the same
table (parent rows, to generate full url). And these rows may be updated
some day. So it should return new value for row#5 if row#3 will be changed.
2. It in turn calls other function that is really IMMUTABLE (say
my_char_replace()) and does not selects from anywhere. But, the
implementation of that (my_char_replace()) function may be changed
someday (it will be recreated).

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message petrov.boris.v@mail.ru 2015-11-17 18:18:11 Re: Question about IMMUTABLE function
Previous Message Felipe Santos 2015-11-17 15:57:19 Re: [pgsql-novice] Daily digest v1.3706 (6 messages)