Question about PG_CONTROL_VERSION 1

Started by Condorabout 5 years ago3 messagesgeneral
Jump to latest
#1Condor
condor@stz-bg.com

Hello,

I try restore from old hard drive an database. The system is not
working, so I install new server, install postgres 9.0.3 and try to copy
postgresql dir to new location but I receive error:

2021-04-14 11:47:04.205 UTC [10285] FATAL: database files are
incompatible with server
2021-04-14 11:47:04.205 UTC [10285] DETAIL: The database cluster was
initialized with PG_CONTROL_VERSION 1, but the server was compiled with
PG_CONTROL_VERSION 903.
2021-04-14 11:47:04.205 UTC [10285] HINT: It looks like you need to
initdb.

How I can start the database or a way to check which files are used for
database that I need it and copy only them ? Did I have a broken files
(probably) ? Is there a way to copy only needed files or some way to
export the data ?

Thanks,
HS

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Condor (#1)
Re: Question about PG_CONTROL_VERSION 1

Condor <condor@stz-bg.com> writes:

I try restore from old hard drive an database. The system is not
working, so I install new server, install postgres 9.0.3 and try to copy
postgresql dir to new location but I receive error:

2021-04-14 11:47:04.205 UTC [10285] FATAL: database files are
incompatible with server
2021-04-14 11:47:04.205 UTC [10285] DETAIL: The database cluster was
initialized with PG_CONTROL_VERSION 1, but the server was compiled with
PG_CONTROL_VERSION 903.
2021-04-14 11:47:04.205 UTC [10285] HINT: It looks like you need to
initdb.

Yeah, that's corrupt :-(. Probably if you try pg_controldata you'll
find that pg_control is a complete mess.

regards, tom lane

#3Condor
condor@stz-bg.com
In reply to: Tom Lane (#2)
Re: Question about PG_CONTROL_VERSION 1

On 14-04-2021 17:41, Tom Lane wrote:

Condor <condor@stz-bg.com> writes:

I try restore from old hard drive an database. The system is not
working, so I install new server, install postgres 9.0.3 and try to
copy
postgresql dir to new location but I receive error:

2021-04-14 11:47:04.205 UTC [10285] FATAL: database files are
incompatible with server
2021-04-14 11:47:04.205 UTC [10285] DETAIL: The database cluster was
initialized with PG_CONTROL_VERSION 1, but the server was compiled
with
PG_CONTROL_VERSION 903.
2021-04-14 11:47:04.205 UTC [10285] HINT: It looks like you need to
initdb.

Yeah, that's corrupt :-(. Probably if you try pg_controldata you'll
find that pg_control is a complete mess.

regards, tom lane

Hello,

thank you. I resolve the issue and get my data back successful. I create
a new database and check the number that new database is created and I
replace only datafiles from old directory to new one. In few years back
I was trying to start similar topic without success, when you have the
data but indexes and/or transaction log is corrupt / broken, how to get
the data back without indexes and transactions log. I export my old
data. Thanks again.

Regards,
HS