Re: Replacing a production db

From: Nicolás Lichtmaier <nico(dot)lichtmaier(at)gmail(dot)com>
To: Bill Moran <wmoran(at)potentialtech(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Replacing a production db
Date: 2014-06-18 20:50:26
Message-ID: CA+MknoC4BvHR4Z3Rgds2X1=jrVNBix54khXEVkcaw49WTqf2aA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm probably doing this wrong, but I couldn't find any resources to learn
how to get this right.

Can the renaming be done without disruption to current connections? From
what I've read you have to disconnect everyone before renaming a database.

2014-06-18 17:47 GMT-03:00 Bill Moran <wmoran(at)potentialtech(dot)com>:

> On Wed, 18 Jun 2014 17:05:22 -0300 Nicolás Lichtmaier <
> nico(dot)lichtmaier(at)gmail(dot)com> wrote:
>
> > Is there a way to replace a production database with another as part of a
> > new "release" of our website?
> >
> > 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?
>
> As someone who's fought with release engineering for a few years now,
> let me start off by saying that you're probably doing it wrong.
>
> That being said, you can rename databases in Postgres just like you
> can in MySQL (in fact, it's more reliable in Postgres) so I don't
> understand why you can't continue to do it that way.
>
> --
> Bill Moran <wmoran(at)potentialtech(dot)com>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tim Clarke 2014-06-18 20:54:15 Re: Replacing a production db
Previous Message Bill Moran 2014-06-18 20:47:08 Re: Replacing a production db