pg.ddx.io pgsql-bugs@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pg_dump does not fully include the schema, causing runtime errors 3+ messages / 3 participants [nested] [flat]
* pg_dump does not fully include the schema, causing runtime errors @ 2017-09-21 14:20 Ian R. Campbell <ian.campbell@thepathcentral.com> 0 siblings, 2 replies; 3+ messages in thread From: Ian R. Campbell @ 2017-09-21 14:20 UTC (permalink / raw) To: 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 ^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: pg_dump does not fully include the schema, causing runtime errors @ 2017-09-21 15:52 Tom Lane <tgl@sss.pgh.pa.us> parent: Ian R. Campbell <ian.campbell@thepathcentral.com> 1 sibling, 0 replies; 3+ messages in thread From: Tom Lane @ 2017-09-21 15:52 UTC (permalink / raw) To: Ian R. Campbell <ian.campbell@thepathcentral.com>; +Cc: pgsql-bugs "Ian R. Campbell" <ian.campbell@thepathcentral.com> writes: > pg_dump uses SET search_path in order to simplify schema references. Yes, it does that intentionally to make the output script easier to edit. > Can pg_dump have an option to output fully qualified schema? I do not care to have to maintain such an option and guarantee that both cases work. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs ^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: pg_dump does not fully include the schema, causing runtime errors @ 2017-09-21 21:31 Stephen Frost <sfrost@snowman.net> parent: Ian R. Campbell <ian.campbell@thepathcentral.com> 1 sibling, 0 replies; 3+ messages in thread From: Stephen Frost @ 2017-09-21 21:31 UTC (permalink / raw) To: Ian R. Campbell <ian.campbell@thepathcentral.com>; +Cc: pgsql-bugs Greetings Ian, * Ian R. Campbell (ian.campbell@thepathcentral.com) wrote: > 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'm not really understanding what this sentence means. Yes, it'll restore OK, and the result should work just fine. What do you mean by "will not execute unless the caller also sets the search_path" ... ? > I have also observed the following output, which suffers the same issue: > > ... role "internal".user_role NOT NULL DEFAULT > 'guest'::user_role ... What is the issue you're referring to? > Can pg_dump have an option to output fully qualified schema? You've not shown why such an option is needed, so it's pretty hard to see why it would make sense to add it. Thanks! Stephen Attachments: signature.asc (application/pgp-signature, 818B) download ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2017-09-21 21:31 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2017-09-21 14:20 pg_dump does not fully include the schema, causing runtime errors Ian R. Campbell <ian.campbell@thepathcentral.com> 2017-09-21 15:52 ` Tom Lane <tgl@sss.pgh.pa.us> 2017-09-21 21:31 ` Stephen Frost <sfrost@snowman.net>
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