Re: patch: Add columns via CREATE OR REPLACE VIEW - Mailing list pgsql-hackers

From David E. Wheeler
Subject Re: patch: Add columns via CREATE OR REPLACE VIEW
Date
Msg-id 4B87C131-A0C3-4716-BAF7-FA0649E9A719@kineticode.com
Whole thread Raw
In response to Re: patch: Add columns via CREATE OR REPLACE VIEW  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Aug 7, 2008, at 13:01, Tom Lane wrote:

>> +1, although what does the standard say?
>
> AFAICT the standard doesn't have any way to alter the definition of an
> existing view at all.  It might be worth asking what other systems do,
> though --- can you alter a view in Oracle or DB2 or mysql?

Looks like MySQL 6.0 just does a CREATE OR REPLACE when you do ALTER
VIEW:
  http://dev.mysql.com/doc/refman/6.0/en/create-view.html  http://dev.mysql.com/doc/refman/6.0/en/alter-view.html

Oracle doesn't seem to do much with it, either, just recompiles a view:
  http://download.oracle.com/docs/cd/B10500_01/server.920/a96540/statements_45a.htm

Note that it says, "This statement does not change the definition of
an existing view. To redefine a view, you must use CREATE VIEW with
the OR REPLACE keywords."

DB2's ALTER VIEW is a bit more promising, though there doesn't seem to
be a way to add columns, just to redefine them:
  http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/admin/r0000894.htm

Best,

David

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: patch: Add columns via CREATE OR REPLACE VIEW
Next
From: "Robert Haas"
Date:
Subject: Re: patch: Add columns via CREATE OR REPLACE VIEW