Re: Issue upgrading from 9.5 to 13 with pg_upgrade: "connection to database failed: FATAL: database "template1" does not exist"

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Jeremy Wilson <jwilson(at)clover(dot)co>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Issue upgrading from 9.5 to 13 with pg_upgrade: "connection to database failed: FATAL: database "template1" does not exist"
Date: 2020-11-13 16:06:42
Message-ID: ea474230-2b08-ccd5-0edb-bc1c976089ce@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/13/20 7:28 AM, Jeremy Wilson wrote:
>
>
>> On Nov 13, 2020, at 10:23 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>
>> Unless ... could it be that there is another PG server active on the
>> machine, whose cluster lacks a "template1" database? Seems unlikely,
>> but you might try confirming with "ps auxww | grep post" or the like.
>
> This is a test environment so only the two databases are on it and neither is running. pg_upgrade checks if either is running.

When you manually run the pg_upgrade pg_ctl script the server starts but
you cannot connect to any database in it correct?

What does pg_upgrade_server.log show when you do above?

>
>> I also wonder if the cluster you're trying to upgrade from has a
>> "template1" database. Not sure if anyone has ever tested whether
>> pg_upgrade can cope with the lack of one.
>
>
> It’s there:
>
> $ psql -p 54320 template1
> psql (13.0, server 9.5.23)
> Type "help" for help.
>
> template1=#
>
>
>

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeremy Wilson 2020-11-13 16:18:14 Re: Issue upgrading from 9.5 to 13 with pg_upgrade: "connection to database failed: FATAL: database "template1" does not exist"
Previous Message Tom Lane 2020-11-13 15:46:23 Re: Issue upgrading from 9.5 to 13 with pg_upgrade: "connection to database failed: FATAL: database "template1" does not exist"