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

Tom Lane wrote:
> 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.

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




view thread (3+ messages)

Message-ID: <3FAFE187.90605@bigfoot.com>
Permalink:  ../3FAFE187.90605@bigfoot.com/
Also on:    postgresql.org/message-id/3FAFE187.90605@bigfoot.com

 · 

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: mendola@bigfoot.com, tgl@sss.pgh.pa.us
  Subject: Re: pg_shadow dump annoying problem
  In-Reply-To: <3FAFE187.90605@bigfoot.com>
  References: <3FAED792.5010508@bigfoot.com> <10747.1068427973@sss.pgh.pa.us> <3FAFE187.90605@bigfoot.com>

* 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