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

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

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Marcin Kowalski <kowalski(at)datrix(dot)co(dot)za>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [SQL] Re: pg_dump potential bug -UNIQUE INDEX on PG_SHADOW Dont!! HELP
Date: 2001-03-30 15:52:52
Message-ID: 200103301552.KAA22347@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-bugspgsql-generalpgsql-hackerspgsql-sql
I can confirm with current sources:

	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
	$

gdb shows that the check in heap_create() is working because the
index name does not begin with pg_, just the base table:

	Breakpoint 1, heap_create (relname=0x838d1d0 "shadow_index", 
	    tupDesc=0x83915e4, istemp=0 '\000', storage_create=0 '\000', 
	    allow_system_table_mods=0) at heap.c:183
	183             bool            nailme = false;

First, should we allow user-specified indexes on system tables, and if
so, why does this error happen?

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


> Hi 
> 
> Regarding my previous post, I just successfully created a unique index on 
> pg_shadow. DON'T DO THIS!!!
> -------
> CREATE UNIQUE INDEX shadow_index ON pg_shadow (usename)
> -------
> I couldn't create at pg_shadow_index as the pg prefix is reserved for 
> system tables. 
> 
> This BROKE the database. At least I can't connect anymore with a:
> -------
> template1=# \c statements
> FATAL 1:  Index 'pg_shadow_name_index' does not exist
> Previous connection kept
> template1=#
> -------
> If I look at the error log I get :
> -------
> ERROR:  Illegal class name 'pg_shadow_index'
>         The 'pg_' name prefix is reserved for system catalogs
> ERROR:  Index 'pg_shadow_name_index' does not exist
> ERROR:  SearchSysCache: recursive use of cache 23
> ERROR:  SearchSysCache: recursive use of cache 23
> ERROR:  SearchSysCache: recursive use of cache 23
> ERROR:  SearchSysCache: recursive use of cache 23 <-- quite psql here
> FATAL 1:  Index 'pg_shadow_name_index' does not exist <-- restarted again
> FATAL 1:  Index 'pg_shadow_name_index' does not exist
> FATAL 1:  Index 'pg_shadow_name_index' does not exist
> -------
> 
> What can I do??? I've got a non-trivial amount of data that I cannot afford 
> to lose!! HELP!..
> 
> Regards
> MArCin - Thanks
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
> 


-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

In response to

Responses

pgsql-hackers by date

Next:From: Zeugswetter Andreas SBDate: 2001-03-30 16:04:08
Subject: AW: Re: [SQL] possible row locking bug in 7.0.3 & 7.1
Previous:From: Bruce MomjianDate: 2001-03-30 15:48:54
Subject: Re: User administration tool

pgsql-sql by date

Next:From: Richard PooleDate: 2001-03-30 16:11:47
Subject: Re: primary key scans in sequence
Previous:From: Tom LaneDate: 2001-03-30 15:33:36
Subject: Re: Possible 7.1RC1 bug

pgsql-admin by date

Next:From: Thomas SattlerDate: 2001-03-30 16:26:25
Subject: {ADMIN} Re: pg_dump potential bug
Previous:From: Bruce MomjianDate: 2001-03-30 15:48:54
Subject: Re: User administration tool

pgsql-bugs by date

Next:From: IGB.NETDate: 2001-03-30 20:51:20
Subject:
Previous:From: Peter EisentrautDate: 2001-03-30 15:06:59
Subject: Re: LATIN2 and wrong upper() and lower() functions output

pgsql-general by date

Next:From: Trewern, BenDate: 2001-03-30 16:12:37
Subject: RE: PostGreSql 7.1
Previous:From: Mitch VincentDate: 2001-03-30 15:18:56
Subject: Re: Memory Tuning

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