- April 26, 2021
Database, Docker, ...
These are my personal notes. Am running postgres docker image on a local linux box. If port 5432 is already in use, run this to see what process is using it: sudo ss -lptn ‘sport = :5432’ the above command will also display the pid using which you can kill the process. For example, if […]
I was trying to install psycopg2 database adapter for PostgreSQL on Ubuntu 18.04. And was always getting an error when doing “pipenv install psycopg2”, complaining about “Python.h” missing. After much head-scratching, I found the issue. Multiple Python distributions confuse psycopg2 installation. Its like this. psycopg2 has two main dependencies libpq-dev python3-dev. On Ubuntu, you install […]
- April 12, 2020
Schema PostgreSQL Schema: Exactly like namespaces in SQL Server (dbo in SQL Server is equivalent to public in PostgreSQL. The default namespace.) Logical container of tables and other database objects You can have multiple schemas in a database Schemas (or namespaces) are useful in production environment in that we can assign users to them and […]
- April 11, 2020
Installation: Bad way First install postgress from ubuntu repos (note: this will lag behind the latest version directly from postgreSQL official page but far easier to install and uninstall). sudo apt update sudo apt install postgresql postgresql-contrib Installation complete. contrib package contains additional postgres utilities. Installation: Latest Version : Right Way Create the file /etc/apt/sources.list.d/pgdg.list […]