Re: Issue upgrading from 9.5 to 13 with pg_upgrade: "connection to database failed: FATAL: database "template1" does not exist" - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Issue upgrading from 9.5 to 13 with pg_upgrade: "connection to database failed: FATAL: database "template1" does not exist"
Date
Msg-id caf8b083-90a7-fb50-eb2e-c57396e5a191@aklaver.com
Whole thread Raw
In response to Re: Issue upgrading from 9.5 to 13 with pg_upgrade: "connection to database failed: FATAL: database "template1" does not exist"  (Jeremy Wilson <jwilson@clover.co>)
List pgsql-general
On 11/13/20 9:12 AM, Jeremy Wilson wrote:
> 
> 
>> On Nov 13, 2020, at 12:06 PM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
>>
>> Hmm. You can still connect if you use?:
>>
>> /usr/pgsql-13/bin/pg_ctl -D /var/lib/pgsql/13/data/ -l logfile start
> 
> Same result.
> 
> bash-4.4$ /usr/pgsql-13/bin/pg_ctl -D /var/lib/pgsql/13/data/ -l logfile start
> waiting for server to start.... done
> server started
> bash-4.4$ psql postgres
> psql: error: could not connect to server: FATAL:  database "postgres" does not exist
> 

In this post:

https://www.postgresql.org/message-id/793E4164-90E9-41F0-B74C-129E1DB76408%40clover.co

it worked. Though in that case pg_upgrade was not run before you ran:

/usr/pgsql-13/bin/pg_ctl -D /var/lib/pgsql/13/data/ -l logfile start

Can you start with clean initdb and then run above command to see if you 
can connect. Then run:

/usr/pgsql-13/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D 
"/var/lib/pgsql/13/data" -o "-p 5432 -b -c synchronous_commit=off -c 
fsync=off -c full_page_writes=off -c vacuum_defer_cleanup_age=0  -c 
listen_addresses='' -c unix_socket_permissions=0700 -c 
unix_socket_directories='/var/lib/pgsql'" start

and see if you can connect. Leave pg_upgrade out of the mix to see if it 
is indeed the issue.



-- 
Adrian Klaver
adrian.klaver@aklaver.com



pgsql-general by date:

Previous
From: Radoslav Nedyalkov
Date:
Subject: Re: conflict with recovery when delay is gone
Next
From: Jeremy Wilson
Date:
Subject: Re: Issue upgrading from 9.5 to 13 with pg_upgrade: "connection to database failed: FATAL: database "template1" does not exist"