Moved from sqlite to postgresql