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