Re: ALTER TABLE schema SCHEMA TO new_schema? - Mailing list pgsql-hackers

From Fernando Nasser
Subject Re: ALTER TABLE schema SCHEMA TO new_schema?
Date
Msg-id 3DEB7DC6.2010801@redhat.com
Whole thread Raw
In response to ALTER TABLE schema SCHEMA TO new_schema?  (Joe Conway <mail@joeconway.com>)
Responses Re: ALTER TABLE schema SCHEMA TO new_schema?
List pgsql-hackers
Joe Conway wrote:
> Christopher Kings-Lynne wrote:
> 
>>> possible. We should probably just go with your suggestion. Anything else
>>> beyond the relnamespace and pg_depend entries that need to be dealt 
>>> with?
>>
>>
>> What about sequences for serial columns?  What about views or types that
>> depend on the table?
>>
> 
> Yeah, good point. I think properly dealing with the pg_depends issues 
> will catch anything of that nature, but what to do with them?
> 
> Probably should move dependent type, constraint, index entries to the 
> same new namespace. We might want to move related sequences, but I'm not 
> sure we'd want to do that silently, since the sequence could be in use 
> for other tables as well. And we should probably restrict the change if 
> there are dependent functions or views. Does this capture the issues?
> 

Why not just leave the sequence and types in the original schema and 
make sure the table refers to them _there_?  We just need to make sure 
we have schema qualified references to the sequences and types.

Indexes, triggers (and constraints), toast tables etc. are related to 
just one table so they can migrate together, I think.

-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9



pgsql-hackers by date:

Previous
From: Prasanna Phadke
Date:
Subject: Re: 7.4 Wishlist
Next
From: Fernando Nasser
Date:
Subject: Re: ALTER TABLE schema SCHEMA TO new_schema?