Re: pg_dump fail to not dump public schema orders

From: Adrien Nayrat <adrien(dot)nayrat(at)anayrat(dot)info>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_dump fail to not dump public schema orders
Date: 2020-05-29 14:42:21
Message-ID: 346b98c6-e3cd-a3e3-b69b-fdfd8d1b43db@anayrat.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 5/29/20 3:56 PM, David G. Johnston wrote:
> On Friday, May 29, 2020, Adrien Nayrat <adrien(dot)nayrat(at)anayrat(dot)info
> <mailto:adrien(dot)nayrat(at)anayrat(dot)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,

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Prabhat Sahu 2020-05-29 14:44:55 PG function with pseudotype "anyelement" for IN, OUT parameter shows wrong behaviour.
Previous Message Tom Lane 2020-05-29 14:40:20 Re: pg_dump fail to not dump public schema orders