Re: Make pg_dump suppress COMMENT ON SCHEMA public ?

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Make pg_dump suppress COMMENT ON SCHEMA public ?
Date: 2008-01-13 12:18:45
Message-ID: 478A01A5.6030406@hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> There was some discussion today about restoring pg_dump output as a
> non-superuser:
> http://archives.postgresql.org/pgsql-admin/2008-01/msg00128.php
>
> In 8.3 we have eliminated one of the major roadblocks to doing that,
> which is that we now allow non-superuser database owners to create
> trusted procedural languages for themselves. There's still a minor
> roadblock, which is that at the moment pg_dump emits a "COMMENT ON
> SCHEMA public" by default, and that fails if you're not the owner
> of schema public, ie, the bootstrap superuser.
>
> In the past we've always written off this kind of thing as just
> cosmetic, but with the increasing performance advantages of doing
> a restore in a single transaction, I think it's important to try
> to eliminate "ignorable errors" in dump/restore. Especially ones
> as silly as this.
>
> Accordingly I propose the attached patch. It's certainly ugly,
> but it's not very much uglier than what was there already.
> Anyone who had a custom comment on schema public would lose it,
> but who does that?
>
> Thoughts?

Could we dump it when it's non-default only? That way the people that
*have* set a custom comment on it will still get it restored, just a
failure in this case. The majority of people who *haven't* set a comment
will not have the problem at all.

I don't really like dropping things in the dump if we can avoid it...

//Magnus

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message James Mansion 2008-01-13 13:35:35 Re: Postgresql Materialized views
Previous Message Michael Meskes 2008-01-13 11:43:12 Re: scan.l: check_escape_warning()