BUG #8606: Materialized View WITH NO DATA bug

From: j(dot)rejda(at)konektel(dot)cz
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #8606: Materialized View WITH NO DATA bug
Date: 2013-11-19 15:35:52
Message-ID: E1VinLE-0005zJ-HB@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 8606
Logged by: Jaroslav Rejda
Email address: j(dot)rejda(at)konektel(dot)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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2013-11-19 17:27:41 Re: Re: [BUGS] BUG #7873: pg_restore --clean tries to drop tables that don't exist
Previous Message Ronan Dunklau 2013-11-19 14:24:44 Server may segfault when using slices on int2vector