PostgreSQL: Manual

From WIKI
Revision as of 21:45, 14 January 2021 by Support (talk | contribs) (→‎Create database and user)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Install to Debian 10

root@server:~$ apt install postgresql

Create database and user

root@server:~$ su postgres
postgres@server:~$ cd
postgres@server:~$ createuser xmpp -P; 
postgres@server:~$ createdb xmpp -O xmpp


or

su -c "psql" - postgres
create user xmpp with password 'password';
create database xmpp;
alter database xmpp owner to xmpp;

If you have any problems connected database, use a program with a graphical interface.

Create schema for Ejabberd

root@server:~$ su postgres
postgres@server:~$ cd
postgres@server:~$ wget https://raw.githubusercontent.com/processone/ejabberd/master/sql/pgsql.new.sql
postgres@server:~$ psql -v ON_ERROR_STOP=on -d xmppdatabase  < pgsql.new.sql

Reindex Database

reindexdb database