Incorrect version of initdb

Started by rob stoneover 5 years ago2 messagesbugs
Jump to latest
#1rob stone
floriparob@gmail.com

Hello,

Installed postgresql-13 from Debian repos.

postgres@roblaptop:/usr/lib/postgresql/13/bin$ initdb -V
initdb (PostgreSQL) 12.4 (Debian 12.4-1)

PG_VERSION is initialised as 12.

However,

postgres@roblaptop:/usr/lib/postgresql/13/bin$ createdb -V
createdb (PostgreSQL) 13.0 (Debian 13.0-2)
pg_ctl (PostgreSQL) 12.4 (Debian 12.4-1)
pg_dump (PostgreSQL) 13.0 (Debian 13.0-2)

Debian OS:- Linux roblaptop 5.8.0-2-amd64 #1 SMP Debian 5.8.10-1 (2020-
09-19) x86_64 GNU/Linux
This is just a development box.

#2Magnus Hagander
magnus@hagander.net
In reply to: rob stone (#1)
Re: Incorrect version of initdb

On Wed, Sep 30, 2020 at 8:01 AM rob stone <floriparob@gmail.com> wrote:

Hello,

Installed postgresql-13 from Debian repos.

postgres@roblaptop:/usr/lib/postgresql/13/bin$ initdb -V
initdb (PostgreSQL) 12.4 (Debian 12.4-1)

This does not execute initdb from the 13 directory, it executes it from the
one in the path.

If you run "./initdb -V", you should see version 13.

PG_VERSION is initialised as 12.

However,

postgres@roblaptop:/usr/lib/postgresql/13/bin$ createdb -V
createdb (PostgreSQL) 13.0 (Debian 13.0-2)
pg_ctl (PostgreSQL) 12.4 (Debian 12.4-1)
pg_dump (PostgreSQL) 13.0 (Debian 13.0-2)

Debian OS:- Linux roblaptop 5.8.0-2-amd64 #1 SMP Debian 5.8.10-1 (2020-
09-19) x86_64 GNU/Linux
This is just a development box.

initdb is in the postgresql-13 package, and createdb is in
postgresql-client-13. Perhaps you only installed/upgraded one of them?

Since you are in debian, you should also look at using pg_createcluster
instead of raw initdb. It'll set things up properly with service starting
and permissions and such things automatically for you there.

--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/&gt;
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/&gt;