Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I have this old language aware diff tool I wrote that already supports CSV format, so what I would do is:

1) Check the record length of the two tables given your RDBMS API.

2) Check the column headers and data types of the tables are the same given your RDBMS API.

3) Only then would I export all triggers associated with the given tables using the RDBMS API and then compare that code using an external SQL language aware diff tool that excludes from comparison white space, comments, and other artifacts of your choosing.

4) Then finally if all else is the same I would export each table as CSV format and then compare that output in a CSV language aware diff tool.

This can all be done with shell scripts.



Well yes, it makes sense that one could just solve this problem however they choose, whether that be through the programming language of their choice or pen and paper. The whole point of the article is to purposefully restrict the use of external tools and see if it can be done wholly within the native SQL environment.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: