This article describes how to install the PostgreSQL database in opensuse. Let's take a look at the installation steps through the following introduction!
Environment
I tested the installation of postgresql 8.4.6 on opensuse 11.3, and the installation of postgresql 9.0.3 on opensuse 11.4. The steps are no different.
Install
- zypper install postgresql-server
Initialization
- Mkdir/usr/local/pgsql
-
- Mkdir/usr/local/pgsql/Data
-
- Chown Postgres/usr/local/pgsql/Data
-
- Initdb-D/usr/local/pgsql/data (this should be executed by the S user)
Enable Service
- Postgres-D/usr/local/pgsql/data or pg_ctl-D/usr/local/pgsql/data-l logfile start
Create databases and users
- psql postgres
-
- create user pub password 'pub';
-
- create database pgsql1 owner pub;
Log on with a new user
- psql -U pub pgsql1
-
- create schema pub authorization pub;
If it is accessed on the local machine, you can. However, if you want to access PostgreSQL on another host, you need to configure the following.
Configure Network Access
1. If the firewall is enabled, add the postgresql service to the allowed service list.
2. Listen for all access requests. Modify/usr/local/pgsql/data/PostgreSQL. conf and change the localhost to *: listen_addresses = '*'.
3. Set accessible IP addresses. 0 is a wildcard. Modify/usr/local/pgsql/data/pg_assist.conf and add host all 0.0.0.0 0.0.0.0 trust to the last line.
This article describes how to install the PostgreSQL database on opensuse. I hope this introduction will bring you some benefits.