alter view, add/drop column

From: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: alter view, add/drop column
Date: 2012-09-05 14:16:17
Message-ID: 0AD01C53605506449BA127FB8B99E5E1180311AA@FMSMSX105.amr.corp.intel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 !

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-09-05 14:38:33 Re: postgres process got stuck in "notify interrupt waiting" status
Previous Message Achilleas Mantzios 2012-09-05 14:01:45 Re: "Too far out of the mainstream"