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

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: 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 21:35:57
Message-ID: 20150306213557.GY29780@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

* Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
> Stephen Frost <sfrost(at)snowman(dot)net> writes:
> > * Matt Landry (lelnet(dot)matt(at)gmail(dot)com) wrote:
> >> postgres=# select datname, datallowconn from pg_database ;
> >> datname | datallowconn
> >> -----------+--------------
> >> template1 | t
> >> template0 | t
> >> postgres | t
> >> reporting | t
> >> (4 rows)
>
> > Right, as I mentioned, template0 shouldn't have datallowconn as 'true'.
> > That's why it's being included in the pg_dumpall.
>
> Perhaps pg_upgrade should deliberately ignore template0 regardless of
> datallowconn? And/or we should hard-wire that into pg_dumpall?

My thinking would be that pg_dumpall should be hard-wired for template0
(just like it is for template1..) and that we should *not* be excluding
databases that are marked as datallowconn = false.. That said, it's not
clear to me what to do there instead. Maybe throw an error or a
warning? The point of pg_dumpall is to dump *all* the databases and at
least the manpage doesn't appear to say anything about "but ignores
databases with datallowconn = false".

> I feel no compulsion whatsoever to preserve any user-initiated changes
> in template0 across an upgrade.

I agree with this, with regard to template0.

Thanks,

Stephen

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2015-03-06 21:57:29 Re: pg_upgrade failing from 9.3 to 9.4 because "template0" already exists
Previous Message Tom Lane 2015-03-06 21:20:05 Re: pg_upgrade failing from 9.3 to 9.4 because "template0" already exists