pg_dump does not fully include the schema, causing runtime errors

From: "Ian R(dot) Campbell" <ian(dot)campbell(at)thepathcentral(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: pg_dump does not fully include the schema, causing runtime errors
Date: 2017-09-21 14:20:28
Message-ID: CAOC8YUcUJJywOjBsutUOtg9fQY7Wmg2veKKdLK6Cm8jKVyAcjQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

pg_dump uses SET search_path in order to simplify schema references. Below
is a snippet of a CREATE TABLE definition that references a function in the
'internal' schema:

... stock_balances integer[] DEFAULT stock_balances_snapshot() ...

This will restore OK, but it will not execute unless the caller also sets
the search_path, which is certainly not a given or even to be expected.

I have also observed the following output, which suffers the same issue:

... role "internal".user_role NOT NULL DEFAULT
'guest'::user_role ...

Can pg_dump have an option to output fully qualified schema?

Best
Ian Campbell

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2017-09-21 15:52:37 Re: pg_dump does not fully include the schema, causing runtime errors
Previous Message paziek 2017-09-21 13:28:41 BUG #14822: Partition check constraint is ignored if parameter is passed from SQL function