Re: change table to view problem

From: Richard Huxton <dev(at)archonet(dot)com>
To: Sim Zacks <sim(at)nospam(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: change table to view problem
Date: 2005-02-03 09:25:54
Message-ID: 4201EE22.7010108@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sim Zacks wrote:
> I merged 2 tables into 1 table and created a view for each of the tables so
> as not to break existing applications. I renamed the old tables with the
> _old suffix in case there was a problem so I could verify against the old
> data.
>
> The problem is that all the views and functions switched the name of the
> table to the renamed table and do not use the new views I have created. Is
> there a recommended way of updating all the views and functions that use
> the table to start using the view?

This is how it's supposed to work. System objects (views, foreign-keys,
some functions etc) track other objects by their OID. Otherwise changes
to table-names, or schema search-paths could wreak havoc.

If you want to attach the views to the new tables then you'll need to
recreate them.

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Julian Scarfe 2005-02-03 09:44:41 Re: pgpool 2.5b2 released
Previous Message Richard Huxton 2005-02-03 09:22:55 Re: Problem with the sequence