Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
To update between compatible versions, you simply replace the executables while the server is down and restart the server. The data directory remains unchanged — minor upgrades are that simple.
On my upgraded system, the postgresql.service fails to start. The status looks like this:
Code:
[root@cardraeh ~]# systemctl status postgresql.service
postgresql.service - PostgreSQL database server
Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled)
Active: failed (Result: exit-code) since Sat 2013-08-17 15:19:16 EST; 56s ago
Process: 21885 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} (code=exited, status=1/FAILURE)
Aug 17 15:19:15 cardraeh.farm.home systemd[1]: Starting PostgreSQL database server...
Aug 17 15:19:16 cardraeh.farm.home systemd[1]: postgresql.service: control process exited, code=exited status=1
Aug 17 15:19:16 cardraeh.farm.home systemd[1]: Failed to start PostgreSQL database server.
Aug 17 15:19:16 cardraeh.farm.home systemd[1]: Unit postgresql.service entered failed state.
/var/log/messages looks like this:
Code:
Aug 17 15:19:15 cardraeh postgresql-check-db-dir[21885]: An old version of the database format was found.
Aug 17 15:19:16 cardraeh postgresql-check-db-dir[21885]: Use "postgresql-setup upgrade" to upgrade to version 9.2.
Aug 17 15:19:16 cardraeh postgresql-check-db-dir[21885]: See /usr/share/doc/postgresql-9.2.4/README.rpm-dist for more information.
Aug 17 15:19:16 cardraeh systemd[1]: postgresql.service: control process exited, code=exited status=1
Aug 17 15:19:16 cardraeh systemd[1]: Unit postgresql.service entered failed state.
Running "postgresql-setup upgrade" gives this:
Code:
[root@cardraeh ~]# postgresql-setup upgrade
Redirecting to /bin/systemctl stop postgresql.service
Upgrading database: failed
See /var/lib/pgsql/pgupgrade.log for details.
The pgupgrade.log looks like this:
Code:
Performing Consistency Checks
-----------------------------
Checking current, bin, and data directories ok
Checking cluster versions ok
connection to database failed: fe_sendauth: no password supplied
could not connect to old postmaster started with the command:
"/usr/lib64/pgsql/postgresql-9.1/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D "/var/lib/pgsql/data-old" -o "-p 5432 -b -c listen_addresses='' -c unix_socket_permissions=0700 -c unix_socket_directory='/var/lib/pgsql'" start
Failure, exiting
It looks as though I have to specify a password to the postgresql-setup process, but there is no man page for postgresql-setup and running it with -h does not help:
The only way I can get the service to start is to initialise a new 9.2 data instance. Because I failed to do a pg_dumpall before upgrading Fedora, I don't have a dumped instance of the database, so I can't recreate the database cluster in 9.2.
What am I doing wrong? Where do I start to debug this problem?
On my upgraded system, the postgresql.service fails to start. The status looks like this:
Code:
[root@cardraeh ~]# systemctl status postgresql.service
postgresql.service - PostgreSQL database server
Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled)
Active: failed (Result: exit-code) since Sat 2013-08-17 15:19:16 EST; 56s ago
Process: 21885 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} (code=exited, status=1/FAILURE)
Aug 17 15:19:15 cardraeh.farm.home systemd[1]: Starting PostgreSQL database server...
Aug 17 15:19:16 cardraeh.farm.home systemd[1]: postgresql.service: control process exited, code=exited status=1
Aug 17 15:19:16 cardraeh.farm.home systemd[1]: Failed to start PostgreSQL database server.
Aug 17 15:19:16 cardraeh.farm.home systemd[1]: Unit postgresql.service entered failed state.
/var/log/messages looks like this:
Code:
Aug 17 15:19:15 cardraeh postgresql-check-db-dir[21885]: An old version of the database format was found.
Aug 17 15:19:16 cardraeh postgresql-check-db-dir[21885]: Use "postgresql-setup upgrade" to upgrade to version 9.2.
Aug 17 15:19:16 cardraeh postgresql-check-db-dir[21885]: See /usr/share/doc/postgresql-9.2.4/README.rpm-dist for more information.
Aug 17 15:19:16 cardraeh systemd[1]: postgresql.service: control process exited, code=exited status=1
Aug 17 15:19:16 cardraeh systemd[1]: Unit postgresql.service entered failed state.
Running "postgresql-setup upgrade" gives this:
Code:
[root@cardraeh ~]# postgresql-setup upgrade
Redirecting to /bin/systemctl stop postgresql.service
Upgrading database: failed
See /var/lib/pgsql/pgupgrade.log for details.
The pgupgrade.log looks like this:
Code:
Performing Consistency Checks
-----------------------------
Checking current, bin, and data directories ok
Checking cluster versions ok
connection to database failed: fe_sendauth: no password supplied
could not connect to old postmaster started with the command:
"/usr/lib64/pgsql/postgresql-9.1/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D "/var/lib/pgsql/data-old" -o "-p 5432 -b -c listen_addresses='' -c unix_socket_permissions=0700 -c unix_socket_directory='/var/lib/pgsql'" start
Failure, exiting
It looks as though I have to specify a password to the postgresql-setup process, but there is no man page for postgresql-setup and running it with -h does not help:
The only way I can get the service to start is to initialise a new 9.2 data instance. Because I failed to do a pg_dumpall before upgrading Fedora, I don't have a dumped instance of the database, so I can't recreate the database cluster in 9.2.
What am I doing wrong? Where do I start to debug this problem?
Any and all help will be gratefully received.
Have you backed up your data?
You might need to do a FULL install of Fedora 19 instead of an upgrade.
During the upgrade between Fedora 17 and Fedora 19 you might have noticed (if you were looking as it was upgrading) that it could not upgrade some items due to some changes of features in Fedora 19.
If you do a FULL install of fedora 19, your postgresql might just about work as it should.
Hope it all works out for you.
I have just upgraded my Fedora system from 17 to 19. In the process, my version of Postgresql was upgraded from 9.1 to 9.2.
The only way I can get the service to start is to initialise a new 9.2 data instance. Because I failed to do a pg_dumpall before upgrading Fedora, I don't have a dumped instance of the database, so I can't recreate the database cluster in 9.2.
What am I doing wrong? Where do I start to debug this problem?
Trouble is, this requires me to have a repository of Postgres 9.1 binaries, which I think is at /usr/lib64/pgsql/postgresql-9.1/bin. When I invoke pg_upgrade, I get this:
Code:
bash-4.2$ pg_upgrade -d data_9.1 -D data -b /usr/lib64/pgsql/postgresql-9.1/bin -B /bin
Performing Consistency Checks
-----------------------------
Checking current, bin, and data directories ok
Checking cluster versions ok
connection to database failed: fe_sendauth: no password supplied
could not connect to old postmaster started with the command:
"/usr/lib64/pgsql/postgresql-9.1/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D "data_9.1" -o "-p 50432 -b -c listen_addresses='' -c unix_socket_permissions=0700 -c unix_socket_directory='/var/lib/pgsql'" start
Failure, exiting
I notice that the command line for the old database includes '-p 50432', whereas postgres usually runs at 5432. Not sure if this is a problem, as I am not sure of what pg_upgrade is trying to do (I assume it tries to start the old postgres on port 50432 and the new one at 5432, so it can draw data from the old server and pump it straight into the new version, but that is a guess on my behalf).
I feel the answer may be to reinstall version 9.1, run pg_dumpall, then reinstall 9.2 and load the dump. How do I force an install of 9.1 over the top of 9.2 on my Fedora 19 system?
Later:
I managed to coerce the system to boot 9.1 and 9.2 instances on their respective databases and was then able to run pg_dumpall, to extract my data from the old db. I was then able to run psql -f <dumpfile> postgres. All is now as I want it.
Thanks for those who helped me clarify my thinking.
Last edited by Doug Hutcheson; 08-18-2013 at 01:52 AM.
Reason: Solved it!
Trouble is, this requires me to have a repository of Postgres 9.1 binaries, which I think is at /usr/lib64/pgsql/postgresql-9.1/bin.
No worries. First, be sure to copy your postgresql data files (i.e. your databases) to a different location, just to be safe. Then, remove the existing postgresql 9.2 packages manually, either through your GUI based package manager or RPM. After that, you can scroll down on the link given above, and download a 9.1 package and install it. From there, you can fire up your old 9.1 database and do an export (in case its needed), then try the patched 9.2 packages above.
Quote:
I notice that the command line for the old database includes '-p 50432', whereas postgres usually runs at 5432. Not sure if this is a problem, as I am not sure of what pg_upgrade is trying to do (I assume it tries to start the old postgres on port 50432 and the new one at 5432, so it can draw data from the old server and pump it straight into the new version, but that is a guess on my behalf).
I feel the answer may be to reinstall version 9.1, run pg_dumpall, then reinstall 9.2 and load the dump. How do I force an install of 9.1 over the top of 9.2 on my Fedora 19 system?
Later:
I managed to coerce the system to boot 9.1 and 9.2 instances on their respective databases and was then able to run pg_dumpall, to extract my data from the old db. I was then able to run psql -f <dumpfile> postgres. All is now as I want it.
Thanks for those who helped me clarify my thinking.
Well done....I was a bit late answering, though, but glad you got it sorted.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.