>
> Thanks for the patches.  I have tweaked a couple of comments, and
> applied them after merging the whole together.  I have also spent the
> time checking things by breaking some of the internal logic of the
> restore functions, to see if diffs were correctly showing up.
>

My test method was to mis-name one of the objects (i.e. test_clone becomes
test_clone0) and the diffs popped right up.


>
> One thing I was wondering is if the flat functions should call the
> view, but at the end I guess that it does not matter much as long as
> each query is grouped close to the other.  There is no need to expose
> attrelid in the view, information we do not want to show in the type
> of the view anyway.
>

They can't call the view. If the view doesn't contain the object name or
oid, then we can't use it to reference the object, and if it does contain
that then we can't do a (SELECT * FROM A EXCEPT SELECT * FROM B) on one
object vs its clone because it'll always be different. The choice of a view
was just a convenient way to get all the fieldnames and datatypes right
even if they change. I suppose I could have created the view with the oids,
created a type from the view, altered the type to remove the oid columns,
and then had the _flat function select from the view and return the type,
but instead opted to do what I did.

While writing this I kept thinking that the pattern would benefit from the
proposed column exclusion (i.e. SELECT * EXCEPT (a, b) FROM table...)
syntax, but even that wouldn't save us because the ANYARRAY columns would
still need to be cast to text. So my imagined elegant solution isn't out
there, unless we want to define an equality operator between ANYARRAY types.

Thanks for the commits!

Reply via email to