Re: BUG #4374: pg_restore does not restore public schema comment

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: BUG #4374: pg_restore does not restore public schema comment
Дата
Msg-id 48B36E47.3030100@postnewspapers.com.au
обсуждение исходный текст
Ответ на Re: BUG #4374: pg_restore does not restore public schema comment  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #4374: pg_restore does not restore public schema comment  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: BUG #4374: pg_restore does not restore public schema comment  (Daniel Migowski <dmigowski@ikoffice.de>)
Список pgsql-bugs
Tom Lane wrote:
> "Daniel Migowski" <dmigowski@ikoffice.de> writes:
>> Currently a schema dump (custom format, containing the public schema
>> comment) can be restored, but the public schema version is not restored.
>
>> I assume you check if a schema already exists and the skip the schema part.
>
> That assumption is false, so it's not entirely clear to me exactly what
> you are complaining about.  Please provide a specific test case --- what
> did you do, what happened, what would you like to happen instead?

The issue actually appears to be that the comment on default schema like
`public' isn't dumped in the first place.

Setup:

    CREATE DATABASE re;
    \c re
    COMMENT ON SCHEMA public IS 'public comment';
    CREATE SCHEMA testschema;
    COMMENT ON SCHEMA testschema IS 'testschema comment';
    \q

\dn+ shows the comments as set on schema `public' and `testschema'.

The output of:
    pg_dump re
includes the statement:

    COMMENT ON SCHEMA testschema IS 'testschema comment';

but lacks any COMMENT statement for the `public' schema.

So: the user's report is incorrect in blaming pg_restore, but correct in
that comments on the public schema (and presumably other default schema)
aren't preserved by pg_dump | pg_restore. The real reason appears to be
that they're not dumped in the first place.

I haven't checked to see if a custom dump behaves differently.

--
Craig Ringer

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: non-deterministic error related to MIN/MAX optimization
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #4374: pg_restore does not restore public schema comment