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

I don't know whether you'll find it useful, but when I wrote a migrations add-on for Rails, I spent a lot of time learning how to query Postgres and MySQL for the status of current foreign keys, indexes, and "check" constraints, including special extensions like "where" clauses on indexes. If you need to do something similar, perhaps you can borrow the queries from here:

    https://github.com/pjungwir/db_leftovers
If that seems useful and you have any questions, please let me know!


I already have written code for this several times in the past for the basic constraint types, but not the where clauses - I'll check it out. Thanks!




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

Search: