Received: from sss.pgh.pa.us ([216.151.103.158]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f310GDK00146 for ; Sat, 31 Mar 2001 19:16:13 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f310Exw28041; Sat, 31 Mar 2001 19:14:59 -0500 (EST) To: Bruce Momjian cc: Marcin Kowalski , PostgreSQL-development Subject: Re: Re: [SQL] Re: pg_dump potential bug -UNIQUE INDEX on PG_SHADOW Dont!! HELP In-reply-to: <200103301552.KAA22347@candle.pha.pa.us> References: <200103301552.KAA22347@candle.pha.pa.us> Comments: In-reply-to Bruce Momjian message dated "Fri, 30 Mar 2001 10:52:52 -0500" Date: Sat, 31 Mar 2001 19:14:59 -0500 Message-ID: <28038.986084099@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200103/1574 X-Sequence-Number: 6946 Bruce Momjian 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