Re: pg_shadow dump annoying problem

From: Gaetano Mendola <mendola(at)bigfoot(dot)com>
To: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: pg_shadow dump annoying problem
Date: 2003-11-10 19:05:43
Message-ID: 3FAFE187.90605@bigfoot.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Tom Lane wrote:
> Gaetano Mendola <mendola(at)bigfoot(dot)com> 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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Gaetano Mendola 2003-11-10 19:09:16 Re: Trying to pg_restore a 7.1.3 db into 7.3.4 - stalling at 100%
Previous Message Peter Eisentraut 2003-11-10 17:15:53 Re: CREATE DATABASE