pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Gaetano Mendola <mendola@bigfoot.com>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: pg_shadow dump annoying problem
Date: Sun, 09 Nov 2003 20:32:53 -0500
Message-ID: <10747.1068427973@sss.pgh.pa.us> (raw)
In-Reply-To: <3FAED792.5010508@bigfoot.com>
References: <3FAED792.5010508@bigfoot.com>

Gaetano Mendola <mendola@bigfoot.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



view thread (3+ messages)  latest in thread

Message-ID: <10747.1068427973@sss.pgh.pa.us>
Permalink:  ../10747.1068427973@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10747.1068427973@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, mendola@bigfoot.com
  Subject: Re: pg_shadow dump annoying problem
  In-Reply-To: <10747.1068427973@sss.pgh.pa.us>
  References: <3FAED792.5010508@bigfoot.com> <10747.1068427973@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox