Re: pg_upgrade failing from 9.3 to 9.4 because "template0" already exists

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Matt Landry <lelnet(dot)matt(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: pg_upgrade failing from 9.3 to 9.4 because "template0" already exists
Date: 2015-03-06 19:55:42
Message-ID: 54FA063E.2040908@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 03/06/2015 11:22 AM, Matt Landry wrote:
> 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. :)
>
>

Meant to add to previous post, to check with issue that Stephen
mentioned do:

select datname, datallowconn from pg_database ;

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Matt Landry 2015-03-06 20:25:33 Re: pg_upgrade failing from 9.3 to 9.4 because "template0" already exists
Previous Message Vick Khera 2015-03-06 19:54:14 Re: VACUUM FULL doesn't reduce table size