pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: jeff.casavant@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #12465: Materialized view dump restoration issue
Date: Thu, 08 Jan 2015 21:24:29 +0000
Message-ID: <20150108212429.11502.18220@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:      12465
Logged by:          Jeff Casavant
Email address:      jeff.casavant@gmail.com
PostgreSQL version: 9.4.0
Operating system:   Ubuntu 14.04.1
Description:        

If 
 - two functions A and B exist in the public schema
 - A calls B, and
 - a materialized view calls A

then the dump produced by pg_dump or pg_dumpall will throw the following
error when passed to psql -f:

psql:dump.sql:7730: ERROR:  function b() does not exist
LINE 1:  SELECT B() 
                ^
HINT:  No function matches the given name and argument types. You might need
to add explicit type casts.
QUERY:   SELECT B() 
CONTEXT:  SQL function "b" during inlining

Code to reproduce:

create function b() returns int as $$ select 1 $$ language sql;
create function a() returns int as $$ select b() $$ language sql;
create schema qwr;
create materialized view qwr.c as select a();

Then run pg_dump | psql .

Workaround:

Add public to all calls to 'SET search_path' in the dump.


-- 
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: <20150108212429.11502.18220@wrigleys.postgresql.org>
Permalink:  ../20150108212429.11502.18220@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20150108212429.11502.18220@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: jeff.casavant@gmail.com
  Subject: Re: BUG #12465: Materialized view dump restoration issue
  In-Reply-To: <20150108212429.11502.18220@wrigleys.postgresql.org>
  References: <20150108212429.11502.18220@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