pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: j.rejda@konektel.cz
To: pgsql-bugs@postgresql.org
Subject: BUG #8606: Materialized View WITH NO DATA bug
Date: Tue, 19 Nov 2013 15:35:52 +0000
Message-ID: <E1VinLE-0005zJ-HB@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

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



view thread (6+ messages)  latest in thread

Message-ID: <E1VinLE-0005zJ-HB@wrigleys.postgresql.org>
Permalink:  ../E1VinLE-0005zJ-HB@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1VinLE-0005zJ-HB@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: j.rejda@konektel.cz
  Subject: Re: BUG #8606: Materialized View WITH NO DATA bug
  In-Reply-To: <E1VinLE-0005zJ-HB@wrigleys.postgresql.org>
  References: <E1VinLE-0005zJ-HB@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox