From f3ab5d46960023cf8a9df3751ab9748ce01a46a0 Mon Sep 17 00:00:00 2001 From: Noah Misch Date: Fri, 12 Jul 2013 18:21:22 -0400 Subject: Switch user ID to the object owner when populating a materialized view. This makes superuser-issued REFRESH MATERIALIZED VIEW safe regardless of the object's provenance. REINDEX is an earlier example of this pattern. As a downside, functions called from materialized views must tolerate running in a security-restricted operation. CREATE MATERIALIZED VIEW need not change user ID. Nonetheless, avoid creation of materialized views that will invariably fail REFRESH by making it, too, start a security-restricted operation. Back-patch to 9.3 so materialized views have this from the beginning. Reviewed by Kevin Grittner. --- doc/src/sgml/ref/create_materialized_view.sgml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/create_materialized_view.sgml b/doc/src/sgml/ref/create_materialized_view.sgml index 0ed764b3533..b742e17ac82 100644 --- a/doc/src/sgml/ref/create_materialized_view.sgml +++ b/doc/src/sgml/ref/create_materialized_view.sgml @@ -105,7 +105,9 @@ CREATE MATERIALIZED VIEW table_name A , TABLE, - or command. + or command. This query will run within a + security-restricted operation; in particular, calls to functions that + themselves create temporary tables will fail. -- cgit v1.2.3