Hi all,
I'm observing this behavior in 8.2:


kalman=# create table test ( a integer, b integer );
CREATE TABLE
kalman=#
kalman=# CREATE OR REPLACE FUNCTION sp_test ( INTEGER )
kalman-# RETURNS INTEGER AS'
kalman'# DECLARE
kalman'# a_id_contract ALIAS FOR $1;
kalman'# BEGIN
kalman'# RAISE NOTICE ''here'';
kalman'#
kalman'# return 3;
kalman'# END;
kalman'# ' LANGUAGE 'plpgsql';
CREATE FUNCTION
kalman=#
kalman=#
kalman=# CREATE OR REPLACE VIEW v_test AS
kalman-# SELECT
kalman-# a AS a,
kalman-# sp_test(b) AS b
kalman-# FROM
kalman-# test c
kalman-# ;
CREATE VIEW
kalman=#
kalman=# insert into test values (2,3);
INSERT 0 1
kalman=#
kalman=# select * from v_test;
NOTICE: here
a | b
- ---+---
2 | 3
(1 row)

kalman=# select a from v_test;
NOTICE: here
a
- ---
2
(1 row)


In version 8.1 the function sp_test is not evaluated in case of "select a from v_test".

If I mark the function as STABLE or IMMUTABLE then even with version 8.2 the function
is not evaluated. Is this the intended behavior? I didn't see something about it in
the release note.


Regards
Gaetano Mendola

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 13 | next ›
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedMar 6, '07 at 3:58p
activeMar 12, '07 at 1:01p
posts13
users5
websitepostgresql.org...
irc#postgresql

People

Translate

site design / logo © 2022 Grokbase