On Jun 10, 2005, at 11:38 AM, Peter Fein wrote:
>
>> This would obviously have to be pretty damn clever. Amongs the
>> difficulties would be ensuring that the patch applies changes in the
>> correct order (e.g. add column before adding foreign key). It's hard,
>> but I don't believe it's impossible.
>
> As an uninformed, off-the-wall idea, could one compare snapshots of the
> system tables to generate these diffs? I know next-to-nothing about
> these, but it seems like they'd contain the info you'd need.
I think it would be a requirement; I'm not convinced it could be done
just from comparing table definitions. For example, using the table
definitions only, how could you distinguish between renaming the last
column in the table versus dropping the column and adding a new one of
the same type. The target table would be the same, but the semantics of
getting there are not.
John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL