X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3ABEE53F86 for ; Thu, 5 May 2005 15:18:29 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 16271-04 for ; Thu, 5 May 2005 18:18:26 +0000 (GMT) Received: from mail.kavod.com (unknown [66.98.140.24]) by svr1.postgresql.org (Postfix) with ESMTP id 48C3953E20 for ; Thu, 5 May 2005 15:18:25 -0300 (ADT) Received: (qmail 19700 invoked from network); 5 May 2005 17:59:37 -0000 Received: from c-24-20-180-237.hsd1.wa.comcast.net (HELO lx4.kavod.com) (24.20.180.237) by ev1s-66-98-140-24.ev1servers.net with AES256-SHA encrypted SMTP; 5 May 2005 17:59:37 -0000 Received: from lx4.kavod.com (localhost.localdomain [127.0.0.1]) by lx4.kavod.com (8.13.1/8.13.1) with ESMTP id j45IHsh4009408; Thu, 5 May 2005 11:17:54 -0700 Received: (from db@localhost) by lx4.kavod.com (8.13.1/8.13.1/Submit) id j45IHsEe009407; Thu, 5 May 2005 11:17:54 -0700 X-Authentication-Warning: lx4.kavod.com: db set sender to db@kavod.com using -f Date: Thu, 5 May 2005 11:17:54 -0700 From: Daniel Browning To: pgsql-admin@postgresql.org Cc: Daniel Browning Subject: Backup when the database is missing all of the pg_* tables Message-ID: <20050505181754.GA9167@kavod.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200505/79 X-Sequence-Number: 17508 How can I backup a database (for restoration) when it is missing all of the pg_* tables? I've been bitten by the "SELinux silently ruins initdb" bug as reported by Tom Lane: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=149237 and another user: http://www.mail-archive.com/pgsql-bugs@postgresql.org/msg11191.html Unfortunately, I didn't notice the problem until after the database had new data added to it. I need to backup the database and recreate it with initdb, but pg_dump doesn't work: relation "pg_user" does not exist I tried "--data-only --no-owner --no-privileges" to no avail. I can still do '\d ' and 'COPY
to ...', which is enough to get the information needed for a minimal dump, so it's theoretically possible. If there isn't a way to do this already, I'm going to build the schema from a backup, and then write a script that will COPY each table, then COPY them back after the initdb. Thanks, -- Daniel Browning - Kavod Technologies. Random Fortune: Consider well the proportions of things. It is better to be a young June-bug than an old bird of paradise. -- Mark Twain, "Pudd'nhead Wilson's Calendar"