On 5/29/20 3:56 PM, David G. Johnston wrote: > On Friday, May 29, 2020, Adrien Nayrat <adrien.nay...@anayrat.info > <mailto:adrien.nay...@anayrat.info>> wrote: > > Hello, > > I noticed pg_dump failed to not dump creation or comment commands for > public > schema when we explicitly ask it to dump public schema. > > Shorter example: pg_dump -n public dump will give: > > > > [Create schema public....] > > > As far as I can tell this is working as intended/documented. The public > schema > doesn’t and doesn’t and shouldn’t get special treatment relative to any other > user schema here. >
I am not sure. See this comment from selectDumpableNamespace: /* * The public schema is a strange beast that sits in a sort of * no-mans-land between being a system object and a user object. We * don't want to dump creation or comment commands for it, because * that complicates matters for non-superuser use of pg_dump. But we * should dump any ACL changes that have occurred for it, and of * course we should dump contained objects. */ FYI this behavior appeared with pg11. With pg10 you won't have "CREATE SCHEMA public" orders. Regards,