Re: What is the point of create or replace view command

From: Berend Tober <btober(at)seaworthysys(dot)com>
To:
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: What is the point of create or replace view command
Date: 2006-06-05 12:20:23
Message-ID: 44842187.5040803@seaworthysys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Chris Velevitch wrote:
> On 6/5/06, Berend Tober wrote:
>
>> Chris Velevitch wrote:
>> > What is the point of the create or replace view command if you can't
>> > change the column and data types ?
>>
>> You could have a calculated column and change the calcuation.
>>
>> You could change the sort order, selection, or grouping clauses.
>
>
> That's what I'm trying to do but the command won't let me. So what's
> the point of having such a if it won't replace the previous
> definition. I ended up having to drop and the create it again.

Chaning the calculation doesn't necessarily mean changing the result
data type -- what I was referring to was changing the calculation
embedded in the view column definition, like, for example, if you missed
a minus sign in an arithmetic formula, or wanted to concatinate middle
name along with first and last names in a string column. If you drop the
view, then you also lose any rules and defaults defined for the view,
too, and so would have to recreate all that extra stuff. REPLACEing a
view doesn't interfere with these other definitions but allows you to
change the details of the column definitions.

> I'm
> trying to understand the reasoning behind the limit in functionality
> of the command. With my current understanding, it's very useful and
> should be dropped from postgres.

I think we would have to make a more detailed assessment of your current
understanding before finalizing that course of action. :)

-- BMT

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Greg 2006-06-05 12:22:56 Re: Installing PostGreSQL automatically
Previous Message Chris Velevitch 2006-06-05 11:56:01 Re: create view problem