Re: [SQL] Re: pg_dump potential bug -UNIQUE INDEX on PG_SHADOW Dont!! HELP - Mailing list pgsql-admin

From Tom Lane
Subject Re: [SQL] Re: pg_dump potential bug -UNIQUE INDEX on PG_SHADOW Dont!! HELP
Date
Msg-id 28002.986083070@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_dump potential bug -UNIQUE INDEX on PG_SHADOW Dont!! HELP  (Marcin Kowalski <kowalski@datrix.co.za>)
List pgsql-admin
Marcin Kowalski <kowalski@datrix.co.za> writes:
> DON'T DO THIS!!!
> -------
> CREATE UNIQUE INDEX shadow_index ON pg_shadow (usename)
> -------

Indeed, trying to create nonstandard indexes on system catalogs is a BAD
idea.  There probably ought to be a check to prevent you from trying.

> What can I do??? I've got a non-trivial amount of data that I cannot afford
> to lose!! HELP!..

I think you'd be OK if you could drop the index and then do

update pg_class set relhasindex = 'f' where relname = 'pg_shadow';

The trick is to be able to do that when the database is busted.
I think you may be able to do this if you restart in "ignore system
indexes" mode (use "-o -P" while starting postmaster).  Worth a try
anyway.

            regards, tom lane

pgsql-admin by date:

Previous
From: Andrea Fanfani
Date:
Subject: Re: Help - Index on pg_shadow corruption!! Database down!!
Next
From: "IGB.NET"
Date:
Subject: ...