Installing Rpostgresql on Linux

how to install postgresql on Linux

So KDE is your desktop. It could be used on almost any operating system, and probably doesn't determine your install. It's more about distros/OS that you're on. So, what OS are you on? Wild guess Fedora or Ubuntu. Here are the install guides for each:

Fedora: https://fedoraproject.org/wiki/PostgreSQL

Ubuntu: https://www.postgresql.org/download/linux/ubuntu/

Neither is as bad as it seems. Just take them step by step.

BTW, in the Linux world the command line is king. At first, this will seem daunting, but after a while, you'll find it faster for many things. Maybe Learn Enough Command Line to Be Dangerous would help.

Install Postgres on removable volume on linux?

This works just fine. It is not really any different to starting and stopping PostgreSQL and not removing the disk. There are a couple of things to consider though.

  1. You have to make sure it is stopped + writing synced before unmounting the volume. Obvious enough, and I can't believe you'd be able to unmount before sync completed, but worth repeating.

  2. You will want the same version of PostgreSQL, probably on the same version of operating system with the same locales too. Different distributions might compile it with different options.

  3. Although you can put configuration and data in the same directory hierarchy, most distros tend to put config in /etc. If you compile from source yourself this won't be a problem. Alternatively, you can usually override the default locations or, and this is probably simpler, bind-mount the data and config directories into the places your distro expects.

Note that if your storage allows you to connect the same volume to multiple hosts in some sort of "read only" mode that won't work.

Edit: steps from comment moved into body for easier reading.

  1. start up PG, create a table put one row in it.
  2. Stop PG.
  3. Mount your volume at /mnt/db
  4. rsync /var/lib/postgresql/NN/main to /mnt/db/pg_data and /etc/postgresql/NN/main to /mnt/db/pg_etc
  5. rename /var/lib/postgresql/NN/main and add .OLD to the name and do the same with the /etc
  6. bind-mount the dirs from /mnt to replace them
  7. restart PG
  8. Test
  9. Repeat
  10. Return to step 8 until you are happy


Related Topics



Leave a reply



Submit