Support #606
Updated by Daniel Curtis over 9 years ago
This is a guide for installing PostgreSQL 9.4 on FreeBSD 9.3 h2. Setting up the Environment * Start by making sure everything is up to date: <pre> pkg update && pkg upgrade portsnap fetch extract </pre> * Install portmaster: <pre> cd /usr/ports/ports-mgmt/portmaster make install clean pkg2ng </pre> h2. Install PostgreSQL 9.4 * Install PostgreSQL: <pre> portmaster databases/postgresql94-server </pre> * Enable PostgreSQL at boot: <pre> echo 'postgresql_enable="YES"' >> /etc/rc.conf </pre> * Initialize the database: <pre> service postgresql initdb </pre> * Start PostgreSQL: <pre> service postgresql start </pre> h3. Create a new user * Connect Switch to the default database: postgresql user: <pre> su - postgres pgsql psql </pre> #* Set And add a password for the postgres user: new user <pre> \password postgres </pre> #* The postgres admin console will show @postgres=#@, create a new database user and a database: -sdrP bob <pre> CREATE USER pguser WITH PASSWORD 'pgpass'; CREATE DATABASE pgdatabase OWNER pguser; </pre> #* Quit from the database <pre> \q </pre> * Exit from the postgres user When finished exit: <pre> exit </pre> h2. Resources * http://www.freebsddiary.org/postgresql.php * https://jasonk2600.wordpress.com/2010/01/11/installing-postgresql-on-freebsd/