Re: pg_upgrade failing from 9.3 to 9.4 because "template0" already exists - Mailing list pgsql-general

From Matt Landry
Subject Re: pg_upgrade failing from 9.3 to 9.4 because "template0" already exists
Date
Msg-id 54F9FE73.5030800@gmail.com
Whole thread Raw
In response to Re: pg_upgrade failing from 9.3 to 9.4 because "template0" already exists  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: pg_upgrade failing from 9.3 to 9.4 because "template0" already exists  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: pg_upgrade failing from 9.3 to 9.4 because "template0" already exists  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
On 03/06/2015 12:37 PM, Adrian Klaver wrote:
> Agreed, I am just trying to figure out how you get:
>
> CREATE DATABASE "template0" WITH TEMPLATE = template0 ..
>
> Seems to be a snake eating its tail:)

Yes. It does. And it's pretty obvious why having this would be a
problem...not quite so obvious how to not have it.

For the record, I inherited this DB configuration, but I can say with
certainty that we have _one_ actual database with data in it, and it's
not "template0". If it turns out that, in order to do what I need to do,
we need to either drop (or rename, or whatever) template0 or somehow
manually exclude the attempt to upgrade template0, and that for some
reason we have local modifications to that template that will then have
to be re-done, then that's a totally acceptable solution, from my
perspective, as long as we (that is, me and all the people who read the
pg_upgrade documentation in the future) know how to do that.

But figuring out how it managed to get into this condition in the first
place, and how pg_upgrade can be made to programmatically cope with
that, is probably more important for all the users who aren't me. :)


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: pg_upgrade failing from 9.3 to 9.4 because "template0" already exists
Next
From: Adrian Klaver
Date:
Subject: Re: pg_upgrade failing from 9.3 to 9.4 because "template0" already exists