database files are incompatible with server

Started by Igal @ Lucee.orgover 6 years ago10 messagesgeneral
Jump to latest
#1Igal @ Lucee.org
igal@lucee.org

I have a data directory that was created by Postgres 12 (I thought beta
3 but now am not sure anymore) running in Docker.

I have installed Postgres 12b3 as a Systemd service and am trying to set
the cluster to the same PGDATA.  I have set the owner of the directory
to postgres:postrgres, and the permissions to 0700, but I'm getting the
following error:

2019-08-22 23:40:48.759 UTC [23044] FATAL:  database files are
incompatible with server
2019-08-22 23:40:48.759 UTC [23044] DETAIL:  The database cluster was
initialized with CATALOG_VERSION_NO  201906161, but the server was
compiled with CATALOG_VERSION_NO 201907221.

How can I start up the Cluster?

Is version 201906161 beta 2?

Would running PG12 beta 2 work?

Would running initdb destroy the data?

Thank you,

Igal Sapir
Lucee Core Developer
Lucee.org <http://lucee.org/&gt;

#2Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Igal @ Lucee.org (#1)
Re: database files are incompatible with server

On 8/22/19 4:52 PM, Igal @ Lucee.org wrote:

I have a data directory that was created by Postgres 12 (I thought beta
3 but now am not sure anymore) running in Docker.

I have installed Postgres 12b3 as a Systemd service and am trying to set
the cluster to the same PGDATA.  I have set the owner of the directory
to postgres:postrgres, and the permissions to 0700, but I'm getting the
following error:

2019-08-22 23:40:48.759 UTC [23044] FATAL:  database files are
incompatible with server
2019-08-22 23:40:48.759 UTC [23044] DETAIL:  The database cluster was
initialized with CATALOG_VERSION_NO  201906161, but the server was
compiled with CATALOG_VERSION_NO 201907221.

So the cluster is from an older version then the server.

How can I start up the Cluster?

Is version 201906161 beta 2?

Yes:

https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/include/catalog/catversion.h;h=fe44cae3ff453ccc02e6c56548c9311b5777bf1f;hb=0ab7110bcbcce5ff58afb32e7871c54e87502139

Would running PG12 beta 2 work?

Worth a try.

Would running initdb destroy the data?

initdb will not run on a directory with files in it:

bin/initdb -D /usr/local/pgsql11_dev/
The files belonging to this database system will be owned by user
"postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

initdb: directory "/usr/local/pgsql11_dev" exists but is not empty
If you want to create a new database system, either remove or empty
the directory "/usr/local/pgsql11_dev" or run initdb
with an argument other than "/usr/local/pgsql11_dev".

Thank you,

Igal Sapir
Lucee Core Developer
Lucee.org <http://lucee.org/&gt;

--
Adrian Klaver
adrian.klaver@aklaver.com

#3Ron
ronljohnsonjr@gmail.com
In reply to: Adrian Klaver (#2)
Re: database files are incompatible with server

On 8/22/19 7:08 PM, Adrian Klaver wrote:

On 8/22/19 4:52 PM, Igal @ Lucee.org wrote:

I have a data directory that was created by Postgres 12 (I thought beta 3
but now am not sure anymore) running in Docker.

I have installed Postgres 12b3 as a Systemd service and am trying to set
the cluster to the same PGDATA.  I have set the owner of the directory to
postgres:postrgres, and the permissions to 0700, but I'm getting the
following error:

2019-08-22 23:40:48.759 UTC [23044] FATAL:  database files are
incompatible with server
2019-08-22 23:40:48.759 UTC [23044] DETAIL:  The database cluster was
initialized with CATALOG_VERSION_NO  201906161, but the server was
compiled with CATALOG_VERSION_NO 201907221.

So the cluster is from an older version then the server.

Aren't Pg files supposed to be compatible within minor versions?

--
Angular momentum makes the world go 'round.

#4Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Ron (#3)
Re: database files are incompatible with server

On 8/22/19 6:29 PM, Ron wrote:

On 8/22/19 7:08 PM, Adrian Klaver wrote:

On 8/22/19 4:52 PM, Igal @ Lucee.org wrote:

I have a data directory that was created by Postgres 12 (I thought
beta 3 but now am not sure anymore) running in Docker.

I have installed Postgres 12b3 as a Systemd service and am trying to
set the cluster to the same PGDATA.  I have set the owner of the
directory to postgres:postrgres, and the permissions to 0700, but I'm
getting the following error:

2019-08-22 23:40:48.759 UTC [23044] FATAL:  database files are
incompatible with server
2019-08-22 23:40:48.759 UTC [23044] DETAIL:  The database cluster was
initialized with CATALOG_VERSION_NO  201906161, but the server was
compiled with CATALOG_VERSION_NO 201907221.

So the cluster is from an older version then the server.

Aren't Pg files supposed to be compatible within minor versions?

Betas are a moving target so that does not hold:

https://www.postgresql.org/developer/beta/

"Features are subject to changes that are backwards incompatible at any
time during the development of the betas, and could possibly be removed
altogether."

--
Adrian Klaver
adrian.klaver@aklaver.com

#5Ron
ronljohnsonjr@gmail.com
In reply to: Adrian Klaver (#4)
Re: database files are incompatible with server

On 8/22/19 8:49 PM, Adrian Klaver wrote:

On 8/22/19 6:29 PM, Ron wrote:

On 8/22/19 7:08 PM, Adrian Klaver wrote:

On 8/22/19 4:52 PM, Igal @ Lucee.org wrote:

I have a data directory that was created by Postgres 12 (I thought beta
3 but now am not sure anymore) running in Docker.

I have installed Postgres 12b3 as a Systemd service and am trying to
set the cluster to the same PGDATA.  I have set the owner of the
directory to postgres:postrgres, and the permissions to 0700, but I'm
getting the following error:

2019-08-22 23:40:48.759 UTC [23044] FATAL:  database files are
incompatible with server
2019-08-22 23:40:48.759 UTC [23044] DETAIL:  The database cluster was
initialized with CATALOG_VERSION_NO  201906161, but the server was
compiled with CATALOG_VERSION_NO 201907221.

So the cluster is from an older version then the server.

Aren't Pg files supposed to be compatible within minor versions?

Betas are a moving target so that does not hold:

https://www.postgresql.org/developer/beta/

"Features are subject to changes that are backwards incompatible at any
time during the development of the betas, and could possibly be removed
altogether."

Features as in the on-disk structure?

--
Angular momentum makes the world go 'round.

#6Igal @ Lucee.org
igal@lucee.org
In reply to: Adrian Klaver (#2)
Re: database files are incompatible with server

Adrian,

On 8/22/2019 5:08 PM, Adrian Klaver wrote:

On 8/22/19 4:52 PM, Igal @ Lucee.org wrote:

I have a data directory that was created by Postgres 12 (I thought
beta 3 but now am not sure anymore) running in Docker.

I have installed Postgres 12b3 as a Systemd service and am trying to
set the cluster to the same PGDATA.  I have set the owner of the
directory to postgres:postrgres, and the permissions to 0700, but I'm
getting the following error:

2019-08-22 23:40:48.759 UTC [23044] FATAL:  database files are
incompatible with server
2019-08-22 23:40:48.759 UTC [23044] DETAIL:  The database cluster was
initialized with CATALOG_VERSION_NO  201906161, but the server was
compiled with CATALOG_VERSION_NO 201907221.

So the cluster is from an older version then the server.

How can I start up the Cluster?

Is version 201906161 beta 2?

Yes:

https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/include/catalog/catversion.h;h=fe44cae3ff453ccc02e6c56548c9311b5777bf1f;hb=0ab7110bcbcce5ff58afb32e7871c54e87502139

Thanks for the link.  It's good to know where these things are stored.

Thank you,

Igal

#7Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Ron (#5)
Re: database files are incompatible with server

On 8/22/19 7:12 PM, Ron wrote:

On 8/22/19 8:49 PM, Adrian Klaver wrote:

On 8/22/19 6:29 PM, Ron wrote:

On 8/22/19 7:08 PM, Adrian Klaver wrote:

On 8/22/19 4:52 PM, Igal @ Lucee.org wrote:

I have a data directory that was created by Postgres 12 (I thought
beta 3 but now am not sure anymore) running in Docker.

I have installed Postgres 12b3 as a Systemd service and am trying
to set the cluster to the same PGDATA.  I have set the owner of the
directory to postgres:postrgres, and the permissions to 0700, but
I'm getting the following error:

2019-08-22 23:40:48.759 UTC [23044] FATAL:  database files are
incompatible with server
2019-08-22 23:40:48.759 UTC [23044] DETAIL:  The database cluster
was initialized with CATALOG_VERSION_NO  201906161, but the server
was compiled with CATALOG_VERSION_NO 201907221.

So the cluster is from an older version then the server.

Aren't Pg files supposed to be compatible within minor versions?

Betas are a moving target so that does not hold:

https://www.postgresql.org/developer/beta/

"Features are subject to changes that are backwards incompatible at
any time during the development of the betas, and could possibly be
removed altogether."

Features as in the on-disk structure?

Short version:
T
he error was about the catversion which tracks the system catalog state.
Adding/subtracting features can change that state and make clusters
incompatible.

Long version:

https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/include/catalog/catversion.h;h=fe44cae3ff453ccc02e6c56548c9311b5777bf1f;hb=0ab7110bcbcce5ff58afb32e7871c54e87502139

--
Adrian Klaver
adrian.klaver@aklaver.com

#8Igal @ Lucee.org
igal@lucee.org
In reply to: Adrian Klaver (#2)
Re: database files are incompatible with server

On 8/22/2019 5:08 PM, Adrian Klaver wrote:

On 8/22/19 4:52 PM, Igal @ Lucee.org wrote:

I have a data directory that was created by Postgres 12 (I thought
beta 3 but now am not sure anymore) running in Docker.

I have installed Postgres 12b3 as a Systemd service and am trying to
set the cluster to the same PGDATA.  I have set the owner of the
directory to postgres:postrgres, and the permissions to 0700, but I'm
getting the following error:

2019-08-22 23:40:48.759 UTC [23044] FATAL:  database files are
incompatible with server
2019-08-22 23:40:48.759 UTC [23044] DETAIL:  The database cluster was
initialized with CATALOG_VERSION_NO  201906161, but the server was
compiled with CATALOG_VERSION_NO 201907221.

So the cluster is from an older version then the server.

How can I start up the Cluster?

Is version 201906161 beta 2?

Yes:

https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/include/catalog/catversion.h;h=fe44cae3ff453ccc02e6c56548c9311b5777bf1f;hb=0ab7110bcbcce5ff58afb32e7871c54e87502139

Would running PG12 beta 2 work?

Worth a try.

That worked.  I used the Docker image postgres:12-beta2 to bring up the
server.

One issue that I kept having was error messages like chown: changing
ownership of '...': Permission denied.  That turned out to be an SELinux
issue on the CentOS machine.  I have set SELinux to permissive mode
temporarily to bring the server up.  Sharing it here for the next guy
(most likely my future self).

Thanks again,

Igal

#9Tom Lane
tgl@sss.pgh.pa.us
In reply to: Adrian Klaver (#2)
Re: database files are incompatible with server

Adrian Klaver <adrian.klaver@aklaver.com> writes:

On 8/22/19 4:52 PM, Igal @ Lucee.org wrote:

How can I start up the Cluster?
Is version 201906161 beta 2?

Yes:
https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/include/catalog/catversion.h;h=fe44cae3ff453ccc02e6c56548c9311b5777bf1f;hb=0ab7110bcbcce5ff58afb32e7871c54e87502139

FWIW, if you have both beta2 and beta3 executables at hand, it should
work to do a pg_upgrade to convert the cluster to beta3.

regards, tom lane

#10Igal @ Lucee.org
igal@lucee.org
In reply to: Tom Lane (#9)
Re: database files are incompatible with server

On 8/22/2019 9:15 PM, Tom Lane wrote:

Adrian Klaver <adrian.klaver@aklaver.com> writes:

On 8/22/19 4:52 PM, Igal @ Lucee.org wrote:

How can I start up the Cluster?
Is version 201906161 beta 2?

Yes:
https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/include/catalog/catversion.h;h=fe44cae3ff453ccc02e6c56548c9311b5777bf1f;hb=0ab7110bcbcce5ff58afb32e7871c54e87502139

FWIW, if you have both beta2 and beta3 executables at hand, it should
work to do a pg_upgrade to convert the cluster to beta3.

Good to know!

Thank you,

Igal