alter view, add/drop column - Mailing list pgsql-general

From Gauthier, Dave
Subject alter view, add/drop column
Date
Msg-id 0AD01C53605506449BA127FB8B99E5E1180311AA@FMSMSX105.amr.corp.intel.com
Whole thread Raw
Responses Re: alter view, add/drop column
List pgsql-general

I googled around and found that adding/dropping columns from views is not available. (if not true, I'm all ears).

 

Given that, what's the best way to do this?  I was thinking along the lines of a stored procedure that reads the view's definition, modifies it, drops the view, recreates the view.  The main concern here is that the view drop may fail if someone is using it.  (is that a valid concern?).  The procedure would take as args  a verb (add/delete/rename), an object (column to operate on), new name (optional, not used for delete), maybe a table name to know where in the view def to add the new column.

 

But I'm all ears for other suggestions.

 

Thanks !

 

 

pgsql-general by date:

Previous
From: damien clochard
Date:
Subject: pgBadger 2.0 released
Next
From: Tom Lane
Date:
Subject: Re: postgres process got stuck in "notify interrupt waiting" status