Last edit by philipp October 15, 2017 09:52

How to install Postgres 9.6 in a FreeBSD 10 Jail

This quick guide describes, how to install Postgres 9.6 in a a FreeBSD 10 Jail.

[root@host] ~# warden set flags postgres allow.sysvipc=true

root@jail:/ # pkg install nano postgresql96-server-9.6.2
root@jail:/ # sysrc postgresql_enable=yes
root@jail:/ # service postgresql initdb
root@jail:/ # service postgresql start

root@jail:/ # su postgres 
$ psql postgres
psql (9.6.2)
Type "help" for help.

postgres=# \password postgres
Enter new password: *******

root@jail:/ # nano /var/db/postgres/data96/postgresql.conf
...
listen_addresses = '*'
port = 5432
root@jail:/ # nano /var/db/postgres/data96/pg_hba.conf
host    all             all              0.0.0.0/0               md5
...
root@jail:/ # service postgresql restart
root@jail:/ # psql --username=postgres                                      
psql (9.6.2)                                                                    
Type "help" for help.                                                           

postgres=# \l                                                                   
                             List of databases                                  
   Name    |  Owner   | Encoding | Collate | Ctype |   Access privileges        
-----------+----------+----------+---------+-------+-----------------------     
 postgres  | postgres | UTF8     | C       | C     |                            
 template0 | postgres | UTF8     | C       | C     | =c/postgres          +     
           |          |          |         |       | postgres=CTc/postgres      
 template1 | postgres | UTF8     | C       | C     | =c/postgres          +     
           |          |          |         |       | postgres=CTc/postgres      
(4 rows)                                                

The content on this page is licensed under Creative Commons Attribution 4.0 International license.