Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vip5U-0006Qd-VK for pgsql-bugs@arkaria.postgresql.org; Tue, 19 Nov 2013 17:27:45 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Vip5U-0001YO-1Y for pgsql-bugs@arkaria.postgresql.org; Tue, 19 Nov 2013 17:27:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VinLP-0006m5-M9 for pgsql-bugs@postgresql.org; Tue, 19 Nov 2013 15:36:03 +0000 Received: from mahout.postgresql.org ([2001:4800:7903:4::123]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VinLL-0002H4-Pi for pgsql-bugs@postgresql.org; Tue, 19 Nov 2013 15:36:03 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by mahout.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VinLJ-0005KY-Vu for pgsql-bugs@postgresql.org; Tue, 19 Nov 2013 15:35:59 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.80) (envelope-from ) id 1VinLE-0005zJ-HB for pgsql-bugs@postgresql.org; Tue, 19 Nov 2013 15:35:52 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: BUG #8606: Materialized View WITH NO DATA bug To: pgsql-bugs@postgresql.org From: j.rejda@konektel.cz Message-Id: Date: Tue, 19 Nov 2013 15:35:52 +0000 X-Pg-Spam-Score: -2.4 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 8606 Logged by: Jaroslav Rejda Email address: j.rejda@konektel.cz PostgreSQL version: 9.3.1 Operating system: MS Windows XP SP3 Description: -- Hi, -- please, check this example: -- simple table CREATE TABLE test (cislo integer); INSERT INTO test VALUES (10); -- immutable "long time" math func CREATE FUNCTION long_test(_n bigint) RETURNS bigint AS $BODY$DECLARE _result bigint := 0; _i bigint := 2; BEGIN _n := !! _n; WHILE _i < _n LOOP IF _n % _i = 0 THEN _result := _result + 1; END IF; _i := _i + 1; END LOOP; RETURN _result; END;$BODY$ LANGUAGE plpgsql IMMUTABLE STRICT COST 100; -- this returns "immediately" CREATE MATERIALIZED VIEW test1 AS SELECT long_test(cislo) FROM test WITH NO DATA; -- this returns "after some time" (as long as normal "SELECT long_test(10);" do) CREATE MATERIALIZED VIEW test2 AS SELECT long_test(10) WITH NO DATA; -- it's ok or bug? -- Thanks ... JR -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs