migrated to postgresql

Changes from SQL Lite to Postgresql