Stable functions problem
От | Gaetano Mendola |
---|---|
Тема | Stable functions problem |
Дата | |
Msg-id | cq4758$88$1@floppy.pyrenet.fr обсуждение исходный текст |
Ответы |
Re: Stable functions problem
|
Список | pgsql-hackers |
Hi all, after several weeks away I downloaded today the 8.0rc1 and I tested it with our application. I'm having a bounce of errors because IMMUTABLE and STABLE attributes for some of my functions. Let me explain with an example, what I do is ( plpgsql ) my_id_user = sp_id_user( a_login ); IF my_id_user > 0 THEN RETURN -5; -- error code for existing user END IF; INSERT INTO users ( login ) VALUES ( a_login ); my_id_user = sp_id_user( a_login ); now here I can continue my function using the my_id_user, unfortunatelly that sp_id_user is declared as IMMUTABLE this mean that at the second call of sp_id_user my_id_user will not contain the user id. This was working untill 7.4, is there a way to force sp_id_user to be reevaluated ? That function is declared immutable because is ofthen used in expresssion like this: select * from user_data where id_user = sp_id_user('login'); I believe is a good idea write in the release notes, with a bigger font, this optimization about stable and immutable functions. Regards Gaetano Mendola
В списке pgsql-hackers по дате отправления: