4

Anoyone try to install postgresql in Raspbian Stretch? I follow the instructions to the postgresql'site, but when in type sudo apt-get update, returns the follow error:

N: Skipping acquire of configured file 'main/binary-armhf/Packages' as repository 'http://apt.postgresql.org/pub/repos/apt strech-pgdg InReleas' doesn't support architecture 'armhf'

I read the other post here about installation in Raspian-Jessie. Is the same thing?

goldilocks
  • 60,325
  • 17
  • 117
  • 234
FelipeFonsecabh
  • 157
  • 1
  • 3
  • 9

4 Answers4

4

As of right now (11/24/2017) you can install Postgresql v9.6 (stable/armhf) directly from the default Raspbian repositories via this command in the terminal/shell:

sudo apt install postgresql-9.6

If you need a newer version (10.1, etc.) then you may have to compile from the source. Painful, but doable...

Good luck!

MrChips
  • 993
  • 1
  • 5
  • 11
2

I've built armhf binaries for Raspbian stretch for PostgreSQL 11.2 that you can use by adding the apt repo:

deb https://dl.cloudsmith.io/public/james-coleman/postgresql-arm-debian/deb/raspbian stretch main
jcoleman
  • 121
  • 1
1

To find out the latest version of PostgreSQL (that you can install with apt):

sudo apt-cache search postgresql | less

As of now (12/14/2017) latest version (from the default Raspbian Stretch apt repo; not Jessie or Wheezy) is still postgresql-9.6, but the good news is that there are a lot of extension packages for this version.

1

As others have suggested, you can install PostgreSQL by using:

$ sudo apt install postgresql-9.6

However I would not recommend using PgSQL on RPi unless:

  • your RPi is on battery / UPS or
  • you will put DB on an external hard drive.

It depends on frequency of writing to DB, but I've had 2 failures in last 2 months connected to power failures. One rendered SD card broken and the other corrupted data in PostgreSQL enough to make it unusable. In my case I had backups, but it still makes the solution very unreliable.

Note that the power failures were not frequent - one was caused by the storm while the other... just happened. There might have been others in between, but not many.

johndodo
  • 113
  • 4