Skip site navigation (1) Skip section navigation (2)

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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Marcin Kowalski <kowalski(at)datrix(dot)co(dot)za>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [SQL] Re: pg_dump potential bug -UNIQUE INDEX on PG_SHADOW Dont!! HELP
Date: 2001-04-01 00:14:59
Message-ID: 28038.986084099@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-bugspgsql-generalpgsql-hackerspgsql-sql
Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> 	test=> CREATE UNIQUE INDEX shadow_index ON pg_shadow (usename);
> 	CREATE
> 	test=> select * from pg_shadow;
> 	ERROR:  Index 'pg_shadow_sysid_index' does not exist
> 	test=> \q
> 	$ psql test
> 	psql: FATAL 1:  Index 'pg_shadow_name_index' does not exist
> 	$

> Notice the user wanted an index named shadow_index, but the error
> mentioned is pg_shadow_name_index.

What's failing is catcache lookups on pg_shadow.  The catcache has table
entries that claim that there are indexes on pg_shadow(usename) and
pg_shadow(usesysid).  The system would not work at all, except that
catcache's use of these indexes is defeated by sanity-check code that
notices that relhasindex is FALSE for pg_shadow (line 880 of
catcache.c).

As soon as you create an index on pg_shadow, relhasindex becomes TRUE
and catcache.c starts trying to use these nonexistent indexes for
routine operations like ACL permissions checks.  So, nothing works
anymore.

We ought to create those indexes someday ;-)

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2001-04-01 00:31:38
Subject: Re: [SQL] Re: pg_dump potential bug -UNIQUE INDEX on PG_SHADOW Dont!! HELP
Previous:From: Johnny CristensenDate: 2001-04-01 00:11:49
Subject: ODBC Problems

pgsql-sql by date

Next:From: Tom LaneDate: 2001-04-01 00:18:26
Subject: Re: Vacuum Error
Previous:From: Tom LaneDate: 2001-03-31 23:57:50
Subject: Re: [SQL] Re: pg_dump potential bug -UNIQUE INDEX on PG_SHADOW Dont!! HELP

pgsql-admin by date

Next:From: Tom LaneDate: 2001-04-01 00:53:39
Subject: Re: Re: [SQL] Re: pg_dump potential bug -UNIQUE INDEX on PG_SHADOW Dont!! HELP
Previous:From: Tom LaneDate: 2001-03-31 23:57:50
Subject: Re: [SQL] Re: pg_dump potential bug -UNIQUE INDEX on PG_SHADOW Dont!! HELP

pgsql-bugs by date

Next:From: Tom LaneDate: 2001-04-01 00:53:39
Subject: Re: Re: [SQL] Re: pg_dump potential bug -UNIQUE INDEX on PG_SHADOW Dont!! HELP
Previous:From: Tom LaneDate: 2001-03-31 23:57:50
Subject: Re: [SQL] Re: pg_dump potential bug -UNIQUE INDEX on PG_SHADOW Dont!! HELP

pgsql-general by date

Next:From: Tom LaneDate: 2001-04-01 00:30:18
Subject: Re: Re: Memory Tuning
Previous:From: Tom LaneDate: 2001-03-31 23:57:50
Subject: Re: [SQL] Re: pg_dump potential bug -UNIQUE INDEX on PG_SHADOW Dont!! HELP

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group