X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 80513D1C937 for ; Tue, 29 Jul 2003 16:55:06 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 82663-03 for ; Tue, 29 Jul 2003 13:54:06 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 84B1CD1C936 for ; Tue, 29 Jul 2003 13:55:04 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h6TGt4Q3029908; Tue, 29 Jul 2003 12:55:04 -0400 (EDT) To: valen@tuatha.org Cc: postgres Subject: Re: Postgres db corrupted ? In-reply-to: <20030729162256.GA5304@magicbluesmoke.net> References: <1059470890.5588.41.camel@cosimo.hosting365.ie> <21943.1059489530@sss.pgh.pa.us> <20030729162256.GA5304@magicbluesmoke.net> Comments: In-reply-to "John P. Looney" message dated "Tue, 29 Jul 2003 17:22:56 +0100" Date: Tue, 29 Jul 2003 12:55:04 -0400 Message-ID: <29907.1059497704@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/290 X-Sequence-Number: 9630 "John P. Looney" writes: >> If no go, could we see the output of "select * from pg_database"? > Yep, no worries... > postgres=# select * from pg_database; > datname | datdba | encoding | datistemplate | datallowconn | datlastsysoid | datvacuumxid | datfrozenxid | datpath > -----------------+--------+----------+---------------+--------------+---------------+--------------+--------------+--------- > bbadmin | | 0 | f | t | 16554 | 49 | 49 | Hm, that datdba field actually is NULL, isn't it? That's what you need to fix. The low-level code isn't expecting it to be NULL, and falls over in surprising ways. (Recent releases try to enforce NOT NULL on system catalog columns that mustn't be NULL, but I'm not sure how bulletproof that really is.) I'd try UPDATE pg_database SET datdba = WHERE datdba IS NULL; You could just set them all to 1 (the postgres userid); if you want these databases owned by specific users then see pg_shadow.usesysid for the numbers to insert. Once you have all the entries fixed, do the "VACUUM FULL pg_database" fandango for good luck, and you should be back in business. regards, tom lane