/other/

VPS, Debian 8 install PostgreSQL 9.4

2015-08-27 21:44:10

Base on digitalocean.com

sudo apt-get update
sudo apt-get install postgresql-9.4 postgresql-client-9.4
su - postgres

or

sudo -i - u postgres
psql

Example database with schema, user and table


CREATE DATABASE bbc;
\ connect bbc
CREATE SCHEMA bbc_shop;
CREATE USER bbc_shop WITH PASSWORD 'bbc_shop' NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE;
GRANT ALL ON SCHEMA bbc_shop TO bbc_shop;
GRANT ALL PRIVILEGES ON DATABASE bbc TO bbc_shop;

CREATE TABLE bbc_shop.activity
(
  id    serial PRIMARY KEY NOT NULL,
  title VARCHAR(64)        NOT NULL
);

ALTER TABLE bbc_shop.activity OWNER TO bbc_shop;

-- DROP DATABASE bbc;
-- show all database > \l

-- DROP USER bbc_shop;
-- show all users > \dg

How to create configuration for jboss, you can find in this post.