Re: pg_shadow dump annoying problem

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

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.

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Christian Brosig 2003-11-10 07:33:10 Re: Out of buffer error
Previous Message Gaetano Mendola 2003-11-10 00:10:58 pg_shadow dump annoying problem