Tom Lane wrote: > AFAICS, what Ryan is after would be better served by a separate tool that > would produce a "diff" of the two tables' schemas. Even if we were > willing to overload this error message with everything we know about the > parent column, do you really want to fix discrepancies one column at a > time? And what about properties that can't be uniquely associated with a > single column, such as constraints covering multiple columns? > > Also, I have a feeling that a suitable tool is already out there. A > moment's digging in the list archives found this thread with links to > several candidates: > > https://www.postgresql.org/message-id/flat/561D27E7.5010906%40trustport.com > > and I'm pretty sure there have been other such discussions.
I remember looking some time ago, and most of all the possible candidates were either abandoned or terribly cumbersome to use. I ran across Euler Taveira in a conference sometime later and he told me he had the idea of working on writing such a tool. I was pleased to see his announcement recently: https://www.postgresql.org/message-id/6c9d4a85-55b5-81cc-6f09-8f26a6da2...@timbira.com.br I admit I have not looked at his code, but he had some very good ideas for the complex cases. I think it's worth checking out what he has done. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (email@example.com) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers