pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: kwhickey@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15282: Materialized view with transitive TYPE dependency fails refresh using pg_restore and psql
Date: Tue, 17 Jul 2018 13:11:38 -0400
Message-ID: <17166.1531847498@sss.pgh.pa.us> (raw)
In-Reply-To: <153184074037.1405.15097715315257989847@wrigleys.postgresql.org>
References: <153184074037.1405.15097715315257989847@wrigleys.postgresql.org>

=?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.org> writes:
> A materialized view runs a select query that uses a function on one of its
> projected columns which internally uses an enum TYPE to map the column value
> to an enum value.

> Action and Resulting Error:
> Trying to restore a database setup in the above way will fail with error:
> ERROR:  type "<type_name>" does not exist

If this started happening recently, the problem is likely that the type
is not in the restrictive search_path that dump/restore now uses.  You
could possibly fix it just by schema-qualifying the type name in the
function body.  However, that may only let you get as far as the next
failure of the same kind.  A better fix is to add a "SET search_path"
clause to the function definition so that it works independently of
what the caller's search path is.

			regards, tom lane




view thread (6+ messages)  latest in thread

Message-ID: <17166.1531847498@sss.pgh.pa.us>
Permalink:  ../17166.1531847498@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17166.1531847498@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, kwhickey@gmail.com
  Subject: Re: BUG #15282: Materialized view with transitive TYPE dependency fails refresh using pg_restore and psql
  In-Reply-To: <17166.1531847498@sss.pgh.pa.us>
  References: <153184074037.1405.15097715315257989847@wrigleys.postgresql.org> <17166.1531847498@sss.pgh.pa.us>

* 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