Re: Revisiting BUG #3684: After dump/restore, schema PUBLIC always exists - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Revisiting BUG #3684: After dump/restore, schema PUBLIC always exists
Date
Msg-id 11809.1194627814@sss.pgh.pa.us
Whole thread Raw
In response to Revisiting BUG #3684: After dump/restore, schema PUBLIC always exists  (Pedro Gimeno <pgsql-001@personal.formauri.es>)
Responses Re: Revisiting BUG #3684: After dump/restore, schema PUBLIC always exists  (Pedro Gimeno <pgsql-001@personal.formauri.es>)
Re: Revisiting BUG #3684: After dump/restore, schema PUBLIC always exists  (Pedro Gimeno Fortea <parigalo@formauri.es>)
List pgsql-bugs
Pedro Gimeno <pgsql-001@personal.formauri.es> writes:
> ... it's usually assumed that the purpose of a backup
> is to be able to get things to the exact same state as they were when
> it was created.

The hole in your argument is that this is not so.  The purpose of a
backup is to get the *user's* objects into the same state they were in.
If we applied that reasoning to *system* objects then presumably loading
a dump from an 8.2 database into 8.3 would magically destroy all the new
features in 8.3 (eg all the text search objects).

It might be that the public schema should be considered a user object
not a system object, but you need to make a case specifically about
that, not argue that the behavior is broken in general.

What I would personally suggest is that rather than insisting on public
not being there, you just do
    revoke create on schema public from public;
which is a property that pg_dump *will* preserve.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Douglas Toltzman
Date:
Subject: Re: BUG #3736: server cannot listen
Next
From: Tom Lane
Date:
Subject: Re: BUG #3738: psql crashes on exit.