On Wed, Jul 18, 2001 at 01:08:15PM +1000, Philip Warner wrote:
> At 11:25 18/07/01 +0900, Hiroshi Inoue wrote:
> >
> >Oops I made a mistake.
> >Reference name is needed not an object name,
> >i.e
> > object relid
> > object oid
> > relerence relid
> > reference oid
> > reference name
> >
>
> I think any deisgn needs to cater for attr dependencies. eg.
>
> create table a (f1 int4, f2 int8);
> create view view_a as select f2 from a;
>
> Then
>
> alter table a drop f1; -- Is OK. Should just happen
> alter table a drop f2; -- Should warn about the view, and/or cascade etc.
> alter table a alter f2 float; -- Should trigger a view recompilation.
>
> ...same thing needs to happen with constraints that reference attrs
>
> I *think* tables are the only items that can have subobjects with dependant.
Wouldn't that work simply by using the oid for the column in pg_attribute
as the primary dependency, rather than the table itself, from pg_class? So,
the dependency chain would be:
view -> attribute -> table
So your examples would 'just work', I think.
Ross