Re: Change view definition - do not have to drop it

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: emilu(at)encs(dot)concordia(dot)ca
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Change view definition - do not have to drop it
Date: 2009-06-02 18:47:55
Message-ID: 16563.1243968475@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Emi Lu <emilu(at)encs(dot)concordia(dot)ca> writes:
> Now I need update view1 definition to
> create or replace view view1 as select col1, col2 from new_table;

> However, col1 in new_table is not bpchar. This gives me headache! There
> are tens of dependent views based on view1, so I cannot just drop view1
> and recreate it.

> How I can redefine view1 without dropping it and recreate it?

Cast the new column to bpchar?

If you want to change the output column type of the view, you have to
drop and recreate it.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2009-06-02 18:52:26 Re: Warm standby: 1 to N
Previous Message Tom Lane 2009-06-02 18:45:43 Re: Really out of memory?