ubuntuにold versionのpsqlをインストールして動かす

focalfossaにpsql8.4を入れて、laravel5.7から接続する

$ sudo apt-get install wget ca-certificates
$ wget –quiet -O – https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add –
$ sudo sh -c ‘echo “deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main” >> /etc/apt/sources.list.d/pgdg.list’
$ sudo apt-get update
$ sudo apt –fix-broken install -o Dpkg::Options::=”–force-overwrite”
$ sudo apt-get install postgresql-8.4

$ psql –version
psql (PostgreSQL) 8.4.22

$ sudo apt install -y php
$ sudo apt-get install php7.4-dom php-pgsql
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar create-project –prefer-dist laravel/laravel blog “5.7.*”

.env

DB_CONNECTION=psql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=test
DB_USERNAME=root
DB_PASSWORD=password

postgres-# sudo -u postgres psql
postgres-# create role root with createdb createrole login SUPERUSER password ‘password’;
postgres-# create database test

\c test

$ psql –version
psql (PostgreSQL) 8.4.22
$ php artisan -V
Laravel Framework 5.7.29

test=# \d
List of relations
Schema | Name | Type | Owner
——–+——————-+———-+——-
public | migrations | table | root
public | migrations_id_seq | sequence | root
public | password_resets | table | root
public | users | table | root
public | users_id_seq | sequence | root
(5 rows)

イレギュラーですな