pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Elijah Zupancic <elijah@zupancic.name>
Cc: pgsql-bugs@postgresql.org
Subject: Re: pg_dump search path issue
Date: Wed, 11 Mar 2015 00:49:56 +0000
Message-ID: <871tkwtld3.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <18195.1423099931@sss.pgh.pa.us>
References: <CALy1bpckECR69aRpt3UYxD=02ZLDzZrMHEEMN8PoSQ86-x3nPQ@mail.gmail.com>
	<18195.1423099931@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:

 > Elijah Zupancic <elijah@zupancic.name> writes:
 >> In the SQL dump, you will notice that the SET search_path = xxx
 >> values will often not include the public schema which holds the
 >> functions needed to properly recreate tables that depend on
 >> extensions.

 Tom> All the cases I've seen of this involve user-defined functions
 Tom> that are broken, often dangerously so.

Just found (via a report on irc) a case that doesn't involve functions:

create extension hstore;
create schema foo
  create table t1 (a hstore, b integer)
  create table t2 (a hstore, c integer)
  create view v1 as select * from t1 join t2 using (a);

dump/restore gives:

ERROR:  operator does not exist: public.hstore = public.hstore
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.
STATEMENT:  CREATE VIEW v1 AS
         SELECT t1.a,
            t1.b,
            t2.c
           FROM (t1
             JOIN t2 USING (a));

(the reporting user was actually using ip4r's ip4 type, which makes more
sense as a join column than hstore does, but the idea is the same)

-- 
Andrew (irc:RhodiumToad)


-- 
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: <871tkwtld3.fsf@news-spur.riddles.org.uk>
Permalink:  ../871tkwtld3.fsf@news-spur.riddles.org.uk/
Also on:    postgresql.org/message-id/871tkwtld3.fsf@news-spur.riddles.org.uk

 · 

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: andrew@tao11.riddles.org.uk, tgl@sss.pgh.pa.us, elijah@zupancic.name
  Subject: Re: pg_dump search path issue
  In-Reply-To: <871tkwtld3.fsf@news-spur.riddles.org.uk>
  References: <CALy1bpckECR69aRpt3UYxD=02ZLDzZrMHEEMN8PoSQ86-x3nPQ@mail.gmail.com> <18195.1423099931@sss.pgh.pa.us> <871tkwtld3.fsf@news-spur.riddles.org.uk>

* 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