
I cannot get rid of a sequence:

	gis=# drop sequence geopol.geology_gid_seq;
	ERROR:  cache lookup of relation 8511697 failed

Yes, geology_gid_seq have been created as a consequence of a
geology.gid attribute of type serial.
And.. yes, I've removed the relation with a delete on pg_class.
Where is this sequence-to-relation association stored so that
i can clean it up ?

NOTE: vacuum full does not solve this.

TIA

-strk;

Tue, 30 Dec 2003 11:30:30 +0100
strk <strk@keybit.net>
sticky sequence
strk <strk@keybit.net> writes:
> I cannot get rid of a sequence:
> 	gis=# drop sequence geopol.geology_gid_seq;
> 	ERROR:  cache lookup of relation 8511697 failed
> Yes, geology_gid_seq have been created as a consequence of a
> geology.gid attribute of type serial.
> And.. yes, I've removed the relation with a delete on pg_class.

Shame on you ;-)

> Where is this sequence-to-relation association stored so that
> i can clean it up ?

Most likely the complaint is because there's still a link from table to
sequence in pg_depend.  Get rid of that pg_depend row and you should be
okay.

			regards, tom lane

Tue, 30 Dec 2003 11:29:04 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: sticky sequence 
> I cannot get rid of a sequence:
> 
> 	gis=# drop sequence geopol.geology_gid_seq;
> 	ERROR:  cache lookup of relation 8511697 failed
> 
> Yes, geology_gid_seq have been created as a consequence of a
> geology.gid attribute of type serial.
> And.. yes, I've removed the relation with a delete on pg_class.
> Where is this sequence-to-relation association stored so that
> i can clean it up ?

It's stored in the pg_depend table.  See here:

http://www.postgresql.org/docs/current/static/catalog-pg-depend.html

A really good reason to disable manual catalog modifications by default :)

Chris


Wed, 31 Dec 2003 00:33:36 +0800
Christopher Kings-Lynne <chriskl@familyhealth.com.au>
Re: sticky sequence