https://github.com/javadev/supplierapi
supplierapi
https://github.com/javadev/supplierapi
Last synced: 6 months ago
JSON representation
supplierapi
- Host: GitHub
- URL: https://github.com/javadev/supplierapi
- Owner: javadev
- License: mit
- Created: 2021-12-18T07:11:50.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-08-27T15:33:45.000Z (over 1 year ago)
- Last Synced: 2025-01-31T08:32:54.893Z (11 months ago)
- Language: Java
- Size: 474 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README-DB.md
Awesome Lists containing this project
README
# Data Base Information
###### Setup information and notes. As well as data base related hints and commands.
#### Setup
Main config to **open connection** and **change port**:
`/etc/postgresql/10/main/postgresql.conf`
Changes:
~~~~
listen_addresses = '162.55.164.107,localhost'
port = 7325
~~~~
Host-based authentication file:
`/etc/postgresql/10/main/pg_hba.conf`
Added:
~~~~
host all all 116.202.15.234/32 md5
host all all 162.55.164.107/32 md5
~~~~
#### Status and restart
Postgres status
$ systemctl status postgresql
Postgres status start/stop/restart
$ sudo systemctl stop postgresql
$ sudo systemctl start postgresql
$ sudo systemctl restart postgresql
#### Console
On a server to run postgres console:
`$ sudo -u postgres psql`
or
`$ sudo -i -u postgres`
then
`$ psql`
Exit from console:
`postgres=# \q`
List all user accounts (or roles) in the current PostgreSQL:
`postgres=# \du`
More information:
`postgres=#\du+`
Show databases:
`postgres=# \l`
More information:
`postgres=# \l+`
#### SQL Examples:
Create Role:
~~~~
CREATE ROLE roomdb WITH
LOGIN
NOSUPERUSER
INHERIT
NOCREATEDB
NOCREATEROLE
REPLICATION
PASSWORD 'some_password_here';
~~~~
##### Create Database:
~~~~
CREATE DATABASE room_db
WITH
OWNER = roomdb
ENCODING = 'UTF8'
LC_COLLATE = 'en_US.UTF-8'
LC_CTYPE = 'en_US.UTF-8'
TABLESPACE = pg_default
CONNECTION LIMIT = -1;
~~~~