server_configuration:postgres

PostgreSQL

My main requirement was PostgreSQL for DaVinci Resolve (see below) which required an older version of PostgreSQL. But some general notes on PostgreSQL are here.

General links:

sudo su
 
# Get any updates
apt-get update && apt-get upgrade -y
 
# Find PostgreSQP versions
apt-cache search postgres
 
# Find the metapackage for all (somewhat superfluous)
apt-cache search postgres | grep postgres | grep metapackage
 
# Install ALL
apt-get install postgresql-all
 
# Install just the DB
apt-get install postgresql
sudo -i -u postgres
psql

or

sudo -i -u postgres psql

Taken from:

Tell postgresql to listen on everything

listen_addresses = '*'         # Change from 'localhost' to '*'

Change IP range filtering to all addresses everywhere (comment out the existing line and add a new one as below)

#host   all             all             127.0.0.1/32            md5
host    all             all             0.0.0.0/0               md5
vi /etc/postgresql/12/main/postgresql.conf
vi /etc/postgresql/12/main/pg_hba.conf
/etc/init.d/postgresql restart

Uninstall PostgreSQL

https://askubuntu.com/questions/32730/how-to-remove-postgres-from-my-installation

sudo apt-get --purge remove postgresql*
 
# Clear Folders etc...
sudo rm -rf /var/lib/postgresql/
sudo rm -rf /var/log/postgresql/
sudo rm -rf /etc/postgresql/
 
# Remove accounts
deluser postgres
delgroup postgres
 
# Remove unused packages
sudo apt autoremove

Remove open firewall port:

ufw delete allow 5432

PostgreSQL for DaVinci Resolve

DaVinci Resolve Project Server is the easy and best way to do work sharing and collaboration with resolve. It's supported under windows and mac. The latest version of this can be downloaded from the Blackmagic Design support center under Latest Downloads.

DaVinci Resolve Project Server 17 (Version 17.0), uses PostgreSQL 9.5. To use a remote database (I've got my own virtual server), one can download/install this on a linux machine:

Add PostgreSQL package repository (taken from: https://www.postgresql.org/download/linux/ubuntu/)

# Create the file repository configuration:
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
 
# Import the repository signing key:
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
 
# Update the package lists:
sudo apt-get update

Install specific version:

sudo apt-get -y install postgresql-9.6

Open up for Remote access (see above PostgreSQL section on configuration for remote access):

vi /etc/postgresql/9.6/main/postgresql.conf
vi /etc/postgresql/9.6/main/pg_hba.conf
/etc/init.d/postgresql restart

Open firewall:

ufw allow 5432

Change password for resolve usage:

root@roman-halliday:/home/david# sudo -i -u postgres psql
psql (9.6.21)
Type "help" for help.

postgres=# \password
Enter new password:
Enter it again:
postgres=# \q
  • server_configuration/postgres.txt
  • Last modified: 2021/03/04 09:58
  • by david