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

Re: how to modify a view

From: Shane Ambler <pgsql(at)Sheeky(dot)Biz>
To: tech(at)ubilibet(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: how to modify a view
Date: 2008-05-20 17:13:01
Message-ID: 4833069D.2060601@Sheeky.Biz (view raw, whole thread or download thread mbox)
Lists: pgsql-general
J. Manuel Velasco - UBILIBET wrote:
> Hello,
> The DB I am using has views. I need to modify the view adding one
> field to the QUERY that build the query.
> When I edit the VIEW and add the field, I get the error that tells me
> "It's not possible to change columns number in a view"
> So, do I need to remove the complete VIEW and create a new one ? Or
> there is other way to modify the view. ?¿
> Thanks in advance, --

Yes - The only way to do it is DROP VIEW... then CREATE VIEW... - the
catch is any other views that depend on the view you wish to drop.

<manual quote>
You can only replace a view with a new query that generates the
identical set of columns (i.e., same column names and data types).
</manual quote>


Shane Ambler
pgSQL (at) Sheeky (dot) Biz

Get Sheeky @ http://Sheeky.Biz

In response to


pgsql-general by date

Next:From: Karsten HilbertDate: 2008-05-20 17:35:44
Subject: Re: psql: FATAL: Ident authentication failedforuser"postgres"
Previous:From: Dan JooDate: 2008-05-20 16:47:55
Subject: Re: psql: FATAL: Ident authentication failed foruser"postgres"

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