From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Marcin Kowalski <kowalski@datrix.co.za>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Re: [SQL] Re: pg_dump potential bug -UNIQUE INDEX on PG_SHADOW Dont!! HELP
Date: Sat, 31 Mar 2001 19:14:59 -0500
Message-ID: <28038.986084099@sss.pgh.pa.us> (raw)
In-Reply-To: <200103301552.KAA22347@candle.pha.pa.us>
References: <200103301552.KAA22347@candle.pha.pa.us>
Bruce Momjian <pgman@candle.pha.pa.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, pgman@candle.pha.pa.us, kowalski@datrix.co.za, pgsql-hackers@postgresql.org
Subject: Re: [SQL] Re: pg_dump potential bug -UNIQUE INDEX on PG_SHADOW Dont!! HELP
In-Reply-To: <28038.986084099@sss.pgh.pa.us>
References: <200103301552.KAA22347@candle.pha.pa.us> <28038.986084099@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox