Re: [HACKERS] Invalidating dependent views and functions

2010-05-02 Thread Scott Bailey
Robert Haas wrote: On Fri, Apr 30, 2010 at 3:33 AM, Scott Bailey wrote: Proposal: Add an invalid flag to pg_class. Invalid objects would be ignored when doing dependency checks for DDL statements. And an exception would be thrown when an invalid object is called. This is similar to what Oracle

Re: [HACKERS] Invalidating dependent views and functions

2010-05-01 Thread Robert Haas
On Fri, Apr 30, 2010 at 10:38 AM, Tom Lane wrote: > Scott Bailey writes: >> Proposal: Add an invalid flag to pg_class. Invalid objects would be >> ignored when doing dependency checks for DDL statements. And an >> exception would be thrown when an invalid object is called. > > IMO, the way Oracle

Re: [HACKERS] Invalidating dependent views and functions

2010-04-30 Thread Merlin Moncure
On Fri, Apr 30, 2010 at 8:08 AM, Robert Haas wrote: > On Fri, Apr 30, 2010 at 3:33 AM, Scott Bailey wrote: >> Proposal: Add an invalid flag to pg_class. Invalid objects would be ignored >> when doing dependency checks for DDL statements. And an exception would be >> thrown when an invalid object

Re: [HACKERS] Invalidating dependent views and functions

2010-04-30 Thread Tom Lane
Scott Bailey writes: > Proposal: Add an invalid flag to pg_class. Invalid objects would be > ignored when doing dependency checks for DDL statements. And an > exception would be thrown when an invalid object is called. IMO, the way Oracle does this pretty much sucks, and shouldn't be emulated.

Re: [HACKERS] Invalidating dependent views and functions

2010-04-30 Thread Robert Haas
On Fri, Apr 30, 2010 at 3:33 AM, Scott Bailey wrote: > Proposal: Add an invalid flag to pg_class. Invalid objects would be ignored > when doing dependency checks for DDL statements. And an exception would be > thrown when an invalid object is called. > > This is similar to what Oracle does. And mo

Re: [HACKERS] Invalidating dependent views and functions

2010-04-30 Thread Takahiro Itagaki
Scott Bailey wrote: > Problem: We need to change the last_name column of the people table from > varchar(30) to varchar(50). > Proposal: Add an invalid flag to pg_class. Your example is one of the simplest cases, but there are other complex usages. For example, shrinking varchar length, alteri

[HACKERS] Invalidating dependent views and functions

2010-04-30 Thread Scott Bailey
I've been working on a brute force method of saving view and function source when changes to an underlying object force that object to be dropped. But I think there is a way for Postgres to handle this that wouldn't be too hard to implement and would be extremely useful for us users. Problem: