Function immutable is not during a reindex ?

Поиск
Список
Период
Сортировка
От Mendola Gaetano
Тема Function immutable is not during a reindex ?
Дата
Msg-id 002201c348ea$ab5f4300$10d4a8c0@mm.eutelsat.org
обсуждение исходный текст
Ответы Re: [ADMIN] Function immutable is not during a reindex ?
Список pgsql-bugs
Hi all,
I'm running the followin example on Postgres 7.3.3
I notice that if I declare an immutable function like this:


CREATE OR REPLACE FUNCTION test (integer) RETURNS integer
 AS '
declare
begin
 raise notice ''test called'';
 return $1+1;
end;'
LANGUAGE plpgsql IMMUTABLE;

and I use this function for a partial index:

create table t_a
(
  a integer,
  b integer
);

insert into t_a values ( 1, 0 );
insert into t_a values ( 1, 1 );
insert into t_a values ( 1, 2 );

Now creating an index on that table:

create index idxv on t_a ( b ) where test(3) = b;
NOTICE:  test called
NOTICE:  test called
NOTICE:  test called
CREATE INDEX


the function is immutable but is executed 3 times
( one for each row).

The same if I reindex the table:

reindex table t_a;
NOTICE:  test called
NOTICE:  test called
NOTICE:  test called
REINDEX


Regards
Gaetano Mendola














В списке pgsql-bugs по дате отправления:

Предыдущее
От: Jonas Lindholm
Дата:
Сообщение: Re: Daylight saving bug in PostgreSQL 7.2.1 ?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [ADMIN] Function immutable is not during a reindex ?