Re: What is the point of create or replace view command - Mailing list pgsql-general

From Berend Tober
Subject Re: What is the point of create or replace view command
Date
Msg-id 44842187.5040803@seaworthysys.com
Whole thread Raw
In response to Re: What is the point of create or replace view command  ("Chris Velevitch" <chris.velevitch@gmail.com>)
List 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


pgsql-general by date:

Previous
From: "Harald Armin Massa"
Date:
Subject: Re: Installing PostGreSQL automatically
Next
From: "Greg"
Date:
Subject: Best way to store and retrieve large objects in database for email program