Port schema.sql for PostgreSQL
Port code to PostgreSQL & Python3