The postgres layer for smscd system