Re: Re-create dependent views on ALTER TABLE ALTER COLUMN ... TYPE?

Alex Shulgin <ash@commandprompt.com>

From: ash <ash@commandprompt.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>, Stephen Frost <sfrost@snowman.net>, "pgsql-hackers\@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2014-06-02T15:18:28Z
Lists: pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Robert Haas <robertmhaas@gmail.com> writes:
>> On Mon, Jun 2, 2014 at 8:52 AM, ash <ash@commandprompt.com> wrote:
>>> Should this fail, the user will have to work around it, but most of the
>>> time it could just work.
>
>> You're either missing or choosing to ignore the point that I'm making,
>> which is that we *don't have* the text form of the view anywhere.
>
> Even if we did, I don't think it'd affect this decision.
>
> The real problem in my mind is one of user expectations.  If the database
> silently does something behind your back, people expect that that action
> will be *right* and they don't have to worry about it.  I don't think
> that automatically reparsing views has much chance of clearing that bar.
> In much simpler, non-extensible SQL systems it could probably work, but
> for better or worse Postgres has gone all-in on datatype extensibility.

Alright, I think I can let it go now.  It's just that the behavior was
very counter-intuitive to me (and I guess a lot others) at first.

Thanks all for your time and in-depth explanation!

--
Alex


Commits

  1. Allow CREATE OR REPLACE VIEW to add columns to the _end_ of the view.