BUG #11208: Refresh Materialized View Concurrently bug using user Postgres - Mailing list pgsql-bugs

From bemanuel.pe@gmail.com
Subject BUG #11208: Refresh Materialized View Concurrently bug using user Postgres
Date
Msg-id 20140818212803.2536.42468@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #11208: Refresh Materialized View Concurrently bug using user Postgres
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      11208
Logged by:          Bruno Emanuel de Andrade Silva
Email address:      bemanuel.pe@gmail.com
PostgreSQL version: 9.4beta2
Operating system:   Linux
Description:

tjma_dw=> set role user_dw;

tjma_dw=> CREATE TABLE foo_data AS SELECT i, md5(random()::text) FROM
generate_series(1, 10) i;
SELECT 10
tjma_dw=> CREATE MATERIALIZED VIEW mv_foo AS SELECT * FROM foo_data;
SELECT 10
tjma_dw=> ALTER MATERIALIZED VIEW mv_foo OWNER TO user_dw;
ALTER MATERIALIZED VIEW
tjma_dw=> REFRESH MATERIALIZED VIEW mv_foo;
REFRESH MATERIALIZED VIEW
tjma_dw=> ALTER TABLE foo_data OWNER TO user_dw;
ALTER TABLE
tjma_dw=> REFRESH MATERIALIZED VIEW mv_foo;
REFRESH MATERIALIZED VIEW
tjma_dw=> \d+ mv_foo
                  Materialized view "public.mv_foo"
 Column |  Type   | Modifiers | Storage  | Stats target | Description
--------+---------+-----------+----------+--------------+-------------
 i      | integer |           | plain    |              |
 md5    | text    |           | extended |              |
View definition:
 SELECT foo_data.i,
    foo_data.md5
   FROM foo_data;

tjma_dw=> create unique index on mv_foo (i);
CREATE INDEX
tjma_dw=> \q
--ATÉ AQUI OK
/pgsql/pg94/bin/psql -Upostgres -p 5434 tjma_dw
psql (9.4beta2)
Type "help" for help.

tjma_dw=# \d+ mv_foo ^C
tjma_dw=# refresh materialized view CONCURRENTLY mv_foo;
ERROR:  permission denied for relation pg_temp_432971_2
CONTEXT:  SQL statement "DELETE FROM public.mv_foo mv WHERE ctid
OPERATOR(pg_catalog.=) ANY (SELECT diff.tid FROM pg_temp_10.pg_temp_432971_2
diff WHERE diff.tid IS NOT NULL AND diff.newdata IS NULL)"
--WRONG THING
tjma_dw=#

pgsql-bugs by date:

Previous
From: Tony Locke
Date:
Subject: Re: BUG #11204: Log reason for authentication failure
Next
From: Kevin Grittner
Date:
Subject: Re: BUG #11208: Refresh Materialized View Concurrently bug using user Postgres