X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 33964D1B50F for ; Mon, 10 Nov 2003 00:11:42 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 76787-06 for ; Sun, 9 Nov 2003 20:11:13 -0400 (AST) Received: from smtp.noos.fr (nan-smtp-15.noos.net [212.198.2.123]) by svr1.postgresql.org (Postfix) with ESMTP id DF53CD1B515 for ; Sun, 9 Nov 2003 20:11:09 -0400 (AST) Received: (qmail 4711 invoked by uid 0); 10 Nov 2003 00:11:12 -0000 Received: from unknown (HELO bigfoot.com) ([212.198.40.101]) (envelope-sender ) by 212.198.2.123 (qmail-ldap-1.03) with SMTP for ; 10 Nov 2003 00:11:12 -0000 Message-ID: <3FAED792.5010508@bigfoot.com> Date: Mon, 10 Nov 2003 01:10:58 +0100 From: Gaetano Mendola User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031013 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "pgsql-admin@postgresql.org" Subject: pg_shadow dump annoying problem Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/156 X-Sequence-Number: 11143 Hi all, doing a postgres dump I a couple of time in an annoying problem: # pg_dumpall -g > pg_user.sql # head -n 12 pg_user.sql -- -- PostgreSQL database cluster dump -- \connect "template1" -- -- Users -- 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. May be the "DELETE" phase shall be: DELETE FROM pg_shadow WHERE usesysid <> (SELECT datdba FROM pg_database WHERE datname = 'template0') AND usename <> current_user; am I miss something ? Regards Gaetano Mendola