Re: pg_shadow dump annoying problem

Поиск
Список
Период
Сортировка
Искать
От
Gaetano Mendola
Тема
Re: pg_shadow dump annoying problem
Дата
Msg-id
3FAFE187.90605@bigfoot.com
Ответ на
Список
Дерево обсуждения
pg_shadow dump annoying problem Gaetano Mendola <mendola@bigfoot.com>
Re: pg_shadow dump annoying problem Tom Lane <tgl@sss.pgh.pa.us>
Re: pg_shadow dump annoying problem Gaetano Mendola <mendola@bigfoot.com>
Tom Lane wrote:
> Gaetano Mendola  writes:
> 
>>[ pg_dumpall emits this: ]
>>DELETE FROM pg_shadow WHERE usesysid <> (SELECT datdba FROM pg_database 
>>WHERE datname = 'template0');
> 
> 
>>Now if the file pg_user.sql is used accidentally by a user that is not
>>postgres the result is that all users are deleted ( also the user that
>>is doing the restore ) and no other user is created.
> 
> 
> How so?  If that deletes all users then you have already removed the
> user who owns template0, ie, the user who did initdb.  That is a really
> bad idea.

I didn't say this, I just wrote that if the file generated is used
by a user different the postgres will result in a disaster, and may be is
better not delete all the user except the user that own template0 but
not delete the user that own template0 and the current_user.


Regards
Gaetano Mendola

В списке pgsql-admin по дате отправления
От: me@shanewright.co.uk (Shane Wright)
Дата:
От: Gaetano Mendola
Дата:
FAQ