tags:

views:

101

answers:

1

I am looking for similar commands in Postgres as in Git. The reason is that my debugging is slow in Postges, due to my inability to clone and do things like in Git.

  1. How can I clone a db, like a branch?
  2. How can I create a new "branch"?
  3. Is there some Git mode for Postgres?
  4. How do you deal with errors in Postgres?
    • Do you clone the db, or remove it and create new or something else?
+2  A: 
  1. CREATE DATABASE newdb TEMPLATE olddb.

  2. You can't, if you mean you want copy-on-write. If not, see question 1.

  3. No. How would you expect that to work?

  4. What type of errors? Generally, you have your application respond to errors. If your application is in the database, in the form of stored procedures, you use the builtin exception handling in the language,

Magnus Hagander