"Tom Lane" <[EMAIL PROTECTED]> writes: > Gregory Stark <[EMAIL PROTECTED]> writes: >> That does really suck. But I'm not sure what we can do about it. There's no >> SQL which is entirely equivalent to the resulting view. > > If we were to do anything about it, I think it would have to be to > forbid the original ALTER. But I don't see any good way to detect > the situation, either.
Hm, we could call pg_get_viewdef() on dependent views and then verify that the resulting view compiles without error. For bonus points we could verify that it produces the same parsed view and throw warning if it doesn't. That would give us a warning if you have a view with natural joins which changed meanings. I'm not sure it's worth that much extra work on every ALTER TABLE though. I suppose pg_dump() could have an option to check these things itself but by that point it's too late to do anything about it. -- Gregory Stark EnterpriseDB http://www.enterprisedb.com Ask me about EnterpriseDB's Slony Replication support! ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend