On Wed, Jun 18, 2014 at 05:05:22PM -0300, Nicolás Lichtmaier wrote: > Where I work we have a scheme of pushing code+db releases to "testing" and > then to "production". Most of our databases use MySQL and I was told they > can just rename the db and it works. We are adopting PostgreSQL for some > new developments and we'd like to do something similar. I've tried loading > the dump in a single transaction, but that has many problems as the > database is fairly big for that (some GBs). Is there a trick I'm missing > here? I guess I don't understand why you'd need to rename the database. What is the problem you're trying to solve? Is the idea that you have changes in the schema in the new database that are not reflected in the old database? If so, what do you do with all the data? Doesn't that have to be in the new schema somehow? One thing you can do with PostgreSQL that you can't do with MySQL is change the schema in a transaction. So you could make the schema changes that way. If the idea is instead to run two schemas in parallel (so that you can have old and new versions of the application running at the same time), what you really want to do us use the schema (or namespace) support in Postgres. Be careful with this, however, as it is easy to make a system so convoluted that nobody can understand it. A -- Andrew Sullivan ajs@xxxxxxxxxxxxxxx