If you’re running xeus-sql with a conda-forge PostgreSQL build, you will have to create a symbolic link to /tmp/:

sudo ln -s /var/run/postgresql/.s.PGSQL.5432 /tmp/.s.PGSQL.5432

Create an user:

sudo -u postgres createuser --superuser $USER_NAME

Start the service:

sudo service postgresql start sudo -u $USER_NAME psql

Create a database using the example available on this repository:

pg_restore --dbname=newdvdrental -U $USER_NAME pathto/xeus-sql/examples/dvdrental.tar

You can now run the example contained in examples/PostgreSQL.ipynb.

More information about PostgreSQL can be found in the SOCI documentation.