Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2015
    Posts
    1

    Unanswered: schema and function versioning

    I am halfway through a large project replacing some sql server databases with postgres. I decided that it is necessary to version the schema and keep track of functions so I dumped the schema and functions and placed them into git. I had to manually make a version 1 schema by removing some table constraints that rely on functions and adding them with a v1.0.1 script. I am having a hard to organizing all of this. Currently I have one directory that has all our functions, and a new directory for each version of the schema that applies the previous versions changes so you can build the db at any version. This idea falls short though because I don't know how to keep track of functions properly. I have been reading some good articles on the web, like Jeff Atwood's Get Your Database Under Version Control blog but I have not found any examples of how to keep track functions and schema. I also found an example of schema versioning in one of the cloudera repos https://github.com/cloudera/hive/tre...grade/postgres

    Does anyone have some examples in git or elsewhere that show how to keep track of schema and functions? I need help figuring this all out - the database is getting unruly with too many functions and schema changes. Thanks!

  2. #2
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    Check out Liquibase: http://www.liquibase.org we are quite happy with that (using it for Oracle, Postgres and SQL Server).

    Just recently a new tool for schema management specifically for Postgres has been released: http://postgresql.nabble.com/skit-td5836814.html
    I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags: http://www.dbforums.com/misc.php?do=bbcode#code

    Tips for good questions:

    http://tkyte.blogspot.de/2005/06/how...questions.html
    http://wiki.postgresql.org/wiki/SlowQueryQuestions
    http://catb.org/esr/faqs/smart-questions.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •