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

Re: schema rename sequence issue

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sim Zacks <sim(at)compulab(dot)co(dot)il>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: schema rename sequence issue
Date: 2006-01-30 15:12:27
Message-ID: 5244.1138633947@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-general
Sim Zacks <sim(at)compulab(dot)co(dot)il> writes:
> PostGreSQL 8.01 Gentoo
> I renamed my schema from public to stock, and then I found out it didn't 
> change the schemas of the sequences. After searching through the 
> archives, I found that this was on a bug list and would probably be 
> fixed in version 8.2

Actually, it's fixed in 8.1.

> I needed to fix the sequences in any case, so I tried to do it manually 
> using this code:

> update pg_attrdef set 
> adsrc=replace(adsrc,'public.','stock.'),adbin=replace(adbin,'112 117 98 
> 108 105 99 46','115 116 111 99 107 46');

Like to live dangerously, eh?  Hope you weren't doing this on a database
containing data you cared about.

> However, when I try to insert into the table I get an error that 
> public.sequence name is not found

Did you start a fresh session after modifying the catalog?  I don't
think that cached relation descriptors will react to manual hacks
on pg_attrdef.

			regards, tom lane

In response to

Responses

pgsql-general by date

Next:From: Sim ZacksDate: 2006-01-30 15:28:01
Subject: Re: schema rename sequence issue
Previous:From: Tom LaneDate: 2006-01-30 14:57:37
Subject: Re: postgresql performace degrading after a while

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