Re: How to add columns to view with dependencies

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to add columns to view with dependencies
Date: 2017-04-17 03:40:11
Message-ID: 20170417034011.GB28599@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Apr 16, 2017 at 08:02:54PM -0700, Guyren Howe wrote:
> Seems like a simple question, but I’ve never found a good answer to this and similar issues.
>
> I would think it was safe to let me add columns to a view on which other views depend, but Postgres won’t let me.
>
> I can imagine ways of sort-of dealing with this. I might maintain a SQL file with views to create in a suitable order, Then I could drop all views, edit the definition of one, then run the file, but this is awfully tedious.
>
> What is best practice in this situation?

If you're not re-ordering existing columns, you can use CREATE OR REPLACE VIEW

Justin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2017-04-17 03:52:31 Re: How to add columns to view with dependencies
Previous Message Guyren Howe 2017-04-17 03:02:54 How to add columns to view with dependencies