When trying to refresh a materialized view containing a subquery that uses an underlying function, you get the following error:
orange=# CREATE MATERIALIZED VIEW kevin2 AS
orange-# SELECT t.id, t.name, t.dt
orange-# FROM ( SELECT *
orange(# FROM y
orange(# WHERE y.dt = tpa.get_current_table_date('ip_locations'::text)) t
orange-# JOIN x ON t.id = x.id
orange-# ORDER BY id, name
orange-# Distributed by (id);
SELECT 1
orange=# refresh materialized view kevin2;
ERROR: no pre-assigned OID for relation "pg_temp_2124866" (oid_dispatch.c:692) (seg2 192.168.99.101:35014 pid=6468) (oid_dispatch.c:692)