Bug reference: 14271
Logged by: Anton Dyachenko
Email address: amdja...@gmail.com
PostgreSQL version: 9.5.3
Operating system: Windows
Description:
The issue of this bug in the output of dump.
Current output:
line 40: CREATE SCHEMA public;
Fix of the problem:
CREATE SCHEMA IF NOT EXISTS public;
If there is some problem to change dump generator to do this please do this
at least for --if-exist parameter.
--
Sent via pgsql-bugs mailing list (pgsql...@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
On Mon, Aug 1, 2016 at 11:19 AM, <amdja...@gmail.com> wrote:
> Current output:
> line 40: CREATE SCHEMA public;
>
> Fix of the problem:
> CREATE SCHEMA IF NOT EXISTS public;
>
> If there is some problem to change dump generator to do this please do this
> at least for --if-exist parameter.
Could you describe a little bit more in details the command of pg_dump
that you are using? It would be also good to get an exact idea of the
dump you are seeing, what you think it should do with a detailed
example, and what are the objects on your database at the moment of
taking the dump.
So it looks to me like an appropriate fix would be basically this
in _printTocEntry():
- if (!ropt->dropSchema)
+ if (!(ropt->dropSchema && !ropt->createDB))
plus some suitable adjustment of the comment. I'm too lazy/tired
to test this theory right now, though.