Re: BUG #15263: pg_dump / psql failure. When loading, psql does not see function-based constraints or indices

From: firstname lastname <ceccareb(at)talusmusic(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15263: pg_dump / psql failure. When loading, psql does not see function-based constraints or indices
Date: 2018-07-18 21:47:40
Message-ID: 136380404.83820.1531950460781@webmail.hostway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Peter,

Both of your suggestions work. I opted to change the search path in the dump file. The alternative is is to prefix "public" to hundreds of functions. I do not want to do that. Too much work. In the end, a person should be able to copy his objects a different schema; therefore, one would not want to hard-code a schema name to every object.

Do you consider #15263 a bug? Or starting with 10.x, is this expected behavior?

I attached a zip file. runtest.sh duplicates the problem automatically for you. And you are correct, when I create the database with schema_with_explicit_public.sql, psql loads the dump correctly.

Thanks for your help,

Brian

> On July 13, 2018 at 3:19 AM Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> wrote:
>
>
> On 07.07.18 16:50, ceccareb(at)talusmusic(dot)com wrote:
> > Seems like a reasonable diagnosis. Apparently someone introduced this problem into 10.x. 9 works fine.
> >
> > Is there anything I can do? Or do know if someone is trying to fix this one?
>
> It looks like you might need to fix up your functions to handle schema
> search path changes. Either do SET search_path inside the function or
> attached to the function definition, or explicitly schema-qualify the
> function calls.
>
> --
> Peter Eisentraut http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
dumpfailuretest.zip application/x-zip-compressed 10.1 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2018-07-18 22:04:31 Re: BUG #15263: pg_dump / psql failure. When loading, psql does not see function-based constraints or indices
Previous Message Tom Lane 2018-07-18 16:07:47 Re: BUG #15282: Materialized view with transitive TYPE dependency fails refresh using pg_restore and psql