Everytime I install PostgreSQL in Ubuntu 18.04 (even when I ask apt-get
to specifically install version 11 with a sudo apt-get install postgresq-11
) I get version 10 and version 11 in my system.
andre@linuxrocks:/var/lib/postgresql$ ls -la
total 48
drwxr-xr-x 5 postgres postgres 4096 jul 18 01:17 .
drwxr-xr-x 86 root root 4096 jul 5 14:54 ..
drwxr-xr-x 3 postgres postgres 4096 abr 16 10:19 10
drwxr-xr-x 3 postgres postgres 4096 jul 13 00:37 11
The objects in database repeat themselves in these two folders.
postgres=# \! find ~ -type f -name 16563
/var/lib/postgresql/11/main/base/13132/16563
/var/lib/postgresql/10/main/base/16385/16563
I have two postgresql.conf
, one in every folder, although the DBMS seems to get its configs only from the one in 11 folder.
I've detected this strange behavior after I did a ps -f -u postgres
to see all PostgreSQL processes, and see that my system created duplicated processes (one from 10 folder and another from 11). So I've purged and reinstalled PostgreSQL (with sudo apt-get install postgresq-11
) and now I don't have duplicated processes anymore.
andre@linuxrocks:~$ ps -f -u postgres
UID PID PPID C STIME TTY TIME CMD
postgres 1595 1 0 14:30 ? 00:00:00 /usr/lib/postgresql/11/bin/postgres -D /var/lib/postgresql/11/mai
postgres 1684 1595 0 14:30 ? 00:00:00 postgres: 11/main: logger
postgres 1692 1595 0 14:30 ? 00:00:00 postgres: 11/main: checkpointer
postgres 1693 1595 0 14:30 ? 00:00:00 postgres: 11/main: background writer
postgres 1694 1595 0 14:30 ? 00:00:00 postgres: 11/main: walwriter
postgres 1695 1595 0 14:30 ? 00:00:00 postgres: 11/main: autovacuum launcher
postgres 1696 1595 0 14:30 ? 00:00:00 postgres: 11/main: stats collector
postgres 1697 1595 0 14:30 ? 00:00:00 postgres: 11/main: logical replication launcher
postgres 11074 11073 0 14:33 pts/0 00:00:00 bash
postgres 11078 11074 0 14:33 pts/0 00:00:00 /usr/lib/postgresql/11/bin/psql
postgres 11091 1595 0 14:33 ? 00:00:00 postgres: 11/main: postgres postgres [local] idle
Even so, I have the two folders and duplicated objects. Why this is happening?
sudo apt install aptitude
(if you don't have it already), then you canaptitude why postrgresql-10
. Speculating: Perhaps you have apt set to automatically install recommends and suggests; then something that postrgresql-11 installs might be causing a reverse "dependency" install of -10.