Rod Taylor <rbt@zort.ca> writes:
> REPLACE VIEW shouldn't change the visible structure at all. It defeats
> the purpose.
So what changes to the view should be allowed? Adding new attributes,
but not removing any or changing the properties of an attribute?
(e.g. data type).
In which case, the logic would be:
- construct TupleDesc based on ColumnDefs in view definition
- spin through the pg_attribute tuples that match the relid of
the view we're replacing
- if we find a pg_attribute tuple that is not in the
TupleDesc, bail out
- if we find a pg_attribute tuple that is in the
TupleDesc but has a different data-type (or other
properties), bail out
- if we find a TupleDesc attr that is not in
pg_attribute, add it to pg_atribute
Just want to make sure I understand Rod/Tom's objection before I
implement anything.
(BTW, Gavin asked me to finish off the patch for him -- I'd like to
see this in 7.3....)
Cheers,
Neil
--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC