psql scripts finalized